outputs of genesis coinbase are always unspent

This commit is contained in:
Antoni Spaanderman 2022-01-18 22:25:38 +01:00
parent 3a67bc6425
commit 63939ddbe4
No known key found for this signature in database
GPG Key ID: AE0B68E552E5DF8C

View File

@ -106,11 +106,17 @@ class BitcoinApi implements AbstractBitcoinApi {
const outSpends: IEsploraApi.Outspend[] = [];
const tx = await this.$getRawTransaction(txId, true, false);
for (let i = 0; i < tx.vout.length; i++) {
if (tx.status && tx.status.block_height == 0) {
outSpends.push({
spent: false
});
} else {
const txOut = await this.bitcoindClient.getTxOut(txId, i);
outSpends.push({
spent: txOut === null,
});
}
}
return outSpends;
}