Add coinbase_addresses to extended blocks & table

This commit is contained in:
Mononaut
2024-06-24 06:15:01 +00:00
parent 868dac91c7
commit f9d03b1bb4
8 changed files with 112 additions and 3 deletions

View File

@@ -238,6 +238,11 @@ class BitcoinApi implements AbstractBitcoinApi {
return outspends;
}
async $getCoinbaseTx(blockhash: string): Promise<IEsploraApi.Transaction> {
const txids = await this.$getTxIdsForBlock(blockhash);
return this.$getRawTransaction(txids[0]);
}
$getEstimatedHashrate(blockHeight: number): Promise<number> {
// 120 is the default block span in Core
return this.bitcoindClient.getNetworkHashPs(120, blockHeight);