Merge branch 'master' into nymkappa/search-autofocus
This commit is contained in:
		
						commit
						0217d63927
					
				@ -80,7 +80,7 @@ class ChannelsApi {
 | 
			
		||||
 | 
			
		||||
  public async $searchChannelsById(search: string): Promise<any[]> {
 | 
			
		||||
    try {
 | 
			
		||||
      const searchStripped = search.replace('%', '') + '%';
 | 
			
		||||
      const searchStripped = search.replace(/[^0-9x]/g, '') + '%';
 | 
			
		||||
      const query = `SELECT id, short_id, capacity, status FROM channels WHERE id LIKE ? OR short_id LIKE ? LIMIT 10`;
 | 
			
		||||
      const [rows]: any = await DB.query(query, [searchStripped, searchStripped]);
 | 
			
		||||
      return rows;
 | 
			
		||||
 | 
			
		||||
@ -86,7 +86,7 @@ class Mempool {
 | 
			
		||||
    this.mempoolCache = mempoolData;
 | 
			
		||||
    let count = 0;
 | 
			
		||||
    for (const txid of Object.keys(this.mempoolCache)) {
 | 
			
		||||
      if (this.mempoolCache[txid].sigops == null || this.mempoolCache[txid].effectiveFeePerVsize == null) {
 | 
			
		||||
      if (!this.mempoolCache[txid].sigops || this.mempoolCache[txid].effectiveFeePerVsize == null) {
 | 
			
		||||
        this.mempoolCache[txid] = transactionUtils.extendMempoolTransaction(this.mempoolCache[txid]);
 | 
			
		||||
      }
 | 
			
		||||
      if (this.mempoolCache[txid].order == null) {
 | 
			
		||||
 | 
			
		||||
@ -74,7 +74,7 @@ class TransactionUtils {
 | 
			
		||||
  public extendMempoolTransaction(transaction: IEsploraApi.Transaction): MempoolTransactionExtended {
 | 
			
		||||
    const vsize = Math.ceil(transaction.weight / 4);
 | 
			
		||||
    const fractionalVsize = (transaction.weight / 4);
 | 
			
		||||
    const sigops = Common.isLiquid() ? this.countSigops(transaction) : 0;
 | 
			
		||||
    const sigops = !Common.isLiquid() ? this.countSigops(transaction) : 0;
 | 
			
		||||
    // https://github.com/bitcoin/bitcoin/blob/e9262ea32a6e1d364fb7974844fadc36f931f8c6/src/policy/policy.cpp#L295-L298
 | 
			
		||||
    const adjustedVsize = Math.max(fractionalVsize, sigops *  5); // adjusted vsize = Max(weight, sigops * bytes_per_sigop) / witness_scale_factor
 | 
			
		||||
    const feePerVbytes = (transaction.fee || 0) / fractionalVsize;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user