From a2fef305e036ce0d3a7de2205a166358e2799ce1 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Tue, 5 Aug 2025 00:18:53 -0500 Subject: [PATCH 1/2] Merge bitcoin/bitcoin#28639: refactor: Remove unused nchaintx from SnapshotMetadata constructor, fix test, add test --- src/node/utxo_snapshot.h | 3 +-- src/rpc/blockchain.cpp | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/node/utxo_snapshot.h b/src/node/utxo_snapshot.h index 401d4baaeb92..a58061c90554 100644 --- a/src/node/utxo_snapshot.h +++ b/src/node/utxo_snapshot.h @@ -26,8 +26,7 @@ class SnapshotMetadata 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) { } diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 9ae25ef11ba3..689e3666acff 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2728,7 +2728,7 @@ UniValue CreateUTXOSnapshot( tip->nHeight, tip->GetBlockHash().ToString(), fs::PathToString(path), fs::PathToString(temppath))); - SnapshotMetadata metadata{tip->GetBlockHash(), stats.coins_count, tip->nChainTx}; + SnapshotMetadata metadata{tip->GetBlockHash(), stats.coins_count}; afile << metadata; From a687d4556ac55c509c35830c8172d3d562358996 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Tue, 5 Aug 2025 00:24:45 -0500 Subject: [PATCH 2/2] fix: add missing changes from bitcoin#28639 - Remove wrong nChainTx comment and cast as per Bitcoin commit faa90f6e7b6 - Complete the refactor by removing unnecessary cast to uint64_t Resolves validation issues while preserving Bitcoin intent. Test file changes not applicable as test/functional/feature_assumeutxo.py does not exist in Dash. --- src/rpc/blockchain.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 689e3666acff..f0204af48c24 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2755,9 +2755,7 @@ UniValue CreateUTXOSnapshot( result.pushKV("base_height", tip->nHeight); result.pushKV("path", path.utf8string()); result.pushKV("txoutset_hash", 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; }