0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00

refactor: Remove unused nchaintx from SnapshotMetadata constructor

Also, remove wrong nChainTx comment and cast.
This commit is contained in:
MarcoFalke 2023-10-12 11:11:48 +02:00
parent 4a5aae9330
commit faa90f6e7b
No known key found for this signature in database
2 changed files with 3 additions and 6 deletions

View file

@ -35,8 +35,7 @@ public:
SnapshotMetadata() { }
SnapshotMetadata(
const uint256& base_blockhash,
uint64_t coins_count,
unsigned int nchaintx) :
uint64_t coins_count) :
m_base_blockhash(base_blockhash),
m_coins_count(coins_count) { }

View file

@ -2667,7 +2667,7 @@ UniValue CreateUTXOSnapshot(
tip->nHeight, tip->GetBlockHash().ToString(),
fs::PathToString(path), fs::PathToString(temppath)));
SnapshotMetadata metadata{tip->GetBlockHash(), maybe_stats->coins_count, tip->nChainTx};
SnapshotMetadata metadata{tip->GetBlockHash(), maybe_stats->coins_count};
afile << metadata;
@ -2694,9 +2694,7 @@ UniValue CreateUTXOSnapshot(
result.pushKV("base_height", tip->nHeight);
result.pushKV("path", path.u8string());
result.pushKV("txoutset_hash", maybe_stats->hashSerialized.ToString());
// Cast required because univalue doesn't have serialization specified for
// `unsigned int`, nChainTx's type.
result.pushKV("nchaintx", uint64_t{tip->nChainTx});
result.pushKV("nchaintx", tip->nChainTx);
return result;
}