Always use Core verbose block for summaries indexing
This commit is contained in:
parent
20a8725450
commit
e3bc33e41b
@ -18,20 +18,15 @@ if (parentPort) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function indexBlockSummary(hash: string, height: number): Promise<void> {
|
async function indexBlockSummary(hash: string, height: number): Promise<void> {
|
||||||
let txs;
|
const block = await bitcoinClient.getBlock(hash, 2);
|
||||||
if (config.MEMPOOL.BACKEND === 'esplora') {
|
const txs = block.tx.map(tx => {
|
||||||
txs = (await bitcoinApi.$getTxsForBlock(hash)).map(tx => transactionUtils.extendTransaction(tx));
|
tx.fee = Math.round(tx.fee * 100_000_000);
|
||||||
} else {
|
tx.vout.forEach((vout) => {
|
||||||
const block = await bitcoinClient.getBlock(hash, 2);
|
vout.value = Math.round(vout.value * 100000000);
|
||||||
txs = block.tx.map(tx => {
|
|
||||||
tx.fee = Math.round(tx.fee * 100_000_000);
|
|
||||||
tx.vout.forEach((vout) => {
|
|
||||||
vout.value = Math.round(vout.value * 100000000);
|
|
||||||
});
|
|
||||||
tx.vsize = Math.round(tx.weight / 4); // required for backwards compatibility
|
|
||||||
return tx;
|
|
||||||
});
|
});
|
||||||
}
|
tx.vsize = Math.round(tx.weight / 4); // required for backwards compatibility
|
||||||
|
return tx;
|
||||||
|
});
|
||||||
|
|
||||||
const cpfpSummary = await blocks.$indexCPFP(hash, height, txs);
|
const cpfpSummary = await blocks.$indexCPFP(hash, height, txs);
|
||||||
await blocks.$getStrippedBlockTransactions(hash, true, true, cpfpSummary, height); // This will index the block summary
|
await blocks.$getStrippedBlockTransactions(hash, true, true, cpfpSummary, height); // This will index the block summary
|
||||||
|
Loading…
x
Reference in New Issue
Block a user