outputs of genesis coinbase are always unspent
This commit is contained in:
		
							parent
							
								
									3a67bc6425
								
							
						
					
					
						commit
						63939ddbe4
					
				@ -106,10 +106,16 @@ class BitcoinApi implements AbstractBitcoinApi {
 | 
				
			|||||||
    const outSpends: IEsploraApi.Outspend[] = [];
 | 
					    const outSpends: IEsploraApi.Outspend[] = [];
 | 
				
			||||||
    const tx = await this.$getRawTransaction(txId, true, false);
 | 
					    const tx = await this.$getRawTransaction(txId, true, false);
 | 
				
			||||||
    for (let i = 0; i < tx.vout.length; i++) {
 | 
					    for (let i = 0; i < tx.vout.length; i++) {
 | 
				
			||||||
      const txOut = await this.bitcoindClient.getTxOut(txId, i);
 | 
					      if (tx.status && tx.status.block_height == 0) {
 | 
				
			||||||
      outSpends.push({
 | 
					        outSpends.push({
 | 
				
			||||||
        spent: txOut === null,
 | 
					          spent: false
 | 
				
			||||||
      });
 | 
					        });
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        const txOut = await this.bitcoindClient.getTxOut(txId, i);
 | 
				
			||||||
 | 
					        outSpends.push({
 | 
				
			||||||
 | 
					          spent: txOut === null,
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    return outSpends;
 | 
					    return outSpends;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user