Store hex in coinbase raw - Improve scripsig parsing

This commit is contained in:
nymkappa
2022-03-16 12:10:18 +01:00
parent 94dbec46cf
commit ffb5db69a8
6 changed files with 8 additions and 23 deletions

View File

@@ -108,7 +108,7 @@ class Blocks {
const blockExtended: BlockExtended = Object.assign({ extras: {} }, block);
blockExtended.extras.reward = transactions[0].vout.reduce((acc, curr) => acc + curr.value, 0);
blockExtended.extras.coinbaseTx = transactionUtils.stripCoinbaseTransaction(transactions[0]);
blockExtended.extras.coinbaseRaw = transactionUtils.hex2ascii(blockExtended.extras.coinbaseTx.vin[0].scriptsig);
blockExtended.extras.coinbaseRaw = blockExtended.extras.coinbaseTx.vin[0].scriptsig;
if (block.height === 0) {
blockExtended.extras.medianFee = 0; // 50th percentiles