Skip to content

Commit faa90f6

Browse files
author
MarcoFalke
committed
refactor: Remove unused nchaintx from SnapshotMetadata constructor
Also, remove wrong nChainTx comment and cast.
1 parent 4a5aae9 commit faa90f6

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/node/utxo_snapshot.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ class SnapshotMetadata
3535
SnapshotMetadata() { }
3636
SnapshotMetadata(
3737
const uint256& base_blockhash,
38-
uint64_t coins_count,
39-
unsigned int nchaintx) :
38+
uint64_t coins_count) :
4039
m_base_blockhash(base_blockhash),
4140
m_coins_count(coins_count) { }
4241

src/rpc/blockchain.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2667,7 +2667,7 @@ UniValue CreateUTXOSnapshot(
26672667
tip->nHeight, tip->GetBlockHash().ToString(),
26682668
fs::PathToString(path), fs::PathToString(temppath)));
26692669

2670-
SnapshotMetadata metadata{tip->GetBlockHash(), maybe_stats->coins_count, tip->nChainTx};
2670+
SnapshotMetadata metadata{tip->GetBlockHash(), maybe_stats->coins_count};
26712671

26722672
afile << metadata;
26732673

@@ -2694,9 +2694,7 @@ UniValue CreateUTXOSnapshot(
26942694
result.pushKV("base_height", tip->nHeight);
26952695
result.pushKV("path", path.u8string());
26962696
result.pushKV("txoutset_hash", maybe_stats->hashSerialized.ToString());
2697-
// Cast required because univalue doesn't have serialization specified for
2698-
// `unsigned int`, nChainTx's type.
2699-
result.pushKV("nchaintx", uint64_t{tip->nChainTx});
2697+
result.pushKV("nchaintx", tip->nChainTx);
27002698
return result;
27012699
}
27022700

0 commit comments

Comments
 (0)