scripted-diff: Fix coinstats data member names

Initially these values were 'per block' in an earlier version but were then changed to total values. The names were not updated to reflect that.

-BEGIN VERIFY SCRIPT-
s() { git grep -l "$1" src | xargs sed -i "s/$1/$2/g"; }

s 'm_block_unspendable_amount'              'm_total_unspendable_amount'
s 'm_block_prevout_spent_amount'            'm_total_prevout_spent_amount'
s 'm_block_new_outputs_ex_coinbase_amount'  'm_total_new_outputs_ex_coinbase_amount'
s 'm_block_coinbase_amount'                 'm_total_coinbase_amount'
s 'block_unspendable_amount'                'total_unspendable_amount'
s 'block_prevout_spent_amount'              'total_prevout_spent_amount'
s 'block_new_outputs_ex_coinbase_amount'    'total_new_outputs_ex_coinbase_amount'
s 'block_coinbase_amount'                   'total_coinbase_amount'

s 'unspendables_genesis_block'              'total_unspendables_genesis_block'
s 'unspendables_bip30'                      'total_unspendables_bip30'
s 'unspendables_scripts'                    'total_unspendables_scripts'
s 'unspendables_unclaimed_rewards'          'total_unspendables_unclaimed_rewards'
s 'm_unspendables_genesis_block'            'm_total_unspendables_genesis_block'
s 'm_unspendables_bip30'                    'm_total_unspendables_bip30'
s 'm_unspendables_scripts'                  'm_total_unspendables_scripts'
s 'm_unspendables_unclaimed_rewards'        'm_total_unspendables_unclaimed_rewards'
-END VERIFY SCRIPT-
This commit is contained in:
Fabian Jahr
2021-06-03 01:31:47 +02:00
parent 8ea8c927ac
commit fb65dde147
4 changed files with 93 additions and 93 deletions

View File

@@ -1191,7 +1191,7 @@ static RPCHelpMan gettxoutsetinfo()
ret.pushKV("transactions", static_cast<int64_t>(stats.nTransactions));
ret.pushKV("disk_size", stats.nDiskSize);
} else {
ret.pushKV("total_unspendable_amount", ValueFromAmount(stats.block_unspendable_amount));
ret.pushKV("total_unspendable_amount", ValueFromAmount(stats.total_unspendable_amount));
CCoinsStats prev_stats{hash_type};
@@ -1200,16 +1200,16 @@ static RPCHelpMan gettxoutsetinfo()
}
UniValue block_info(UniValue::VOBJ);
block_info.pushKV("prevout_spent", ValueFromAmount(stats.block_prevout_spent_amount - prev_stats.block_prevout_spent_amount));
block_info.pushKV("coinbase", ValueFromAmount(stats.block_coinbase_amount - prev_stats.block_coinbase_amount));
block_info.pushKV("new_outputs_ex_coinbase", ValueFromAmount(stats.block_new_outputs_ex_coinbase_amount - prev_stats.block_new_outputs_ex_coinbase_amount));
block_info.pushKV("unspendable", ValueFromAmount(stats.block_unspendable_amount - prev_stats.block_unspendable_amount));
block_info.pushKV("prevout_spent", ValueFromAmount(stats.total_prevout_spent_amount - prev_stats.total_prevout_spent_amount));
block_info.pushKV("coinbase", ValueFromAmount(stats.total_coinbase_amount - prev_stats.total_coinbase_amount));
block_info.pushKV("new_outputs_ex_coinbase", ValueFromAmount(stats.total_new_outputs_ex_coinbase_amount - prev_stats.total_new_outputs_ex_coinbase_amount));
block_info.pushKV("unspendable", ValueFromAmount(stats.total_unspendable_amount - prev_stats.total_unspendable_amount));
UniValue unspendables(UniValue::VOBJ);
unspendables.pushKV("genesis_block", ValueFromAmount(stats.unspendables_genesis_block - prev_stats.unspendables_genesis_block));
unspendables.pushKV("bip30", ValueFromAmount(stats.unspendables_bip30 - prev_stats.unspendables_bip30));
unspendables.pushKV("scripts", ValueFromAmount(stats.unspendables_scripts - prev_stats.unspendables_scripts));
unspendables.pushKV("unclaimed_rewards", ValueFromAmount(stats.unspendables_unclaimed_rewards - prev_stats.unspendables_unclaimed_rewards));
unspendables.pushKV("genesis_block", ValueFromAmount(stats.total_unspendables_genesis_block - prev_stats.total_unspendables_genesis_block));
unspendables.pushKV("bip30", ValueFromAmount(stats.total_unspendables_bip30 - prev_stats.total_unspendables_bip30));
unspendables.pushKV("scripts", ValueFromAmount(stats.total_unspendables_scripts - prev_stats.total_unspendables_scripts));
unspendables.pushKV("unclaimed_rewards", ValueFromAmount(stats.total_unspendables_unclaimed_rewards - prev_stats.total_unspendables_unclaimed_rewards));
block_info.pushKV("unspendables", unspendables);
ret.pushKV("block_info", block_info);