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
2 changed files with 3 additions and 6 deletions

View File

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

View File

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