From 931684b24a89aba884cb18c13fa67ccca339ee8c Mon Sep 17 00:00:00 2001 From: James O'Beirne Date: Wed, 14 Apr 2021 13:29:27 -0400 Subject: validation: fix ActivateSnapshot to use hardcoded nChainTx This fixes an oversight from the move of nChainTx from the user-supplied snapshot metadata into the hardcoded assumeutxo chainparams. Since the nChainTx is now unused in the metadata, it should be removed in a future commit. --- src/node/utxo_snapshot.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/node') diff --git a/src/node/utxo_snapshot.h b/src/node/utxo_snapshot.h index fe78cb46bd..4767d49889 100644 --- a/src/node/utxo_snapshot.h +++ b/src/node/utxo_snapshot.h @@ -24,6 +24,8 @@ public: //! Necessary to "fake" the base nChainTx so that we can estimate progress during //! initial block download for the assumeutxo chainstate. + //! + //! TODO: this is unused and should be removed. unsigned int m_nchaintx = 0; SnapshotMetadata() { } -- cgit v1.2.3 From 91d93aac4e3fe6fff5ef492ed152c4d8fa6f2672 Mon Sep 17 00:00:00 2001 From: James O'Beirne Date: Fri, 23 Apr 2021 13:29:53 -0400 Subject: validation: remove nchaintx from assumeutxo metadata This value is no longer used and is instead specified statically in chainparams. This change means that previously generated snapshots will no longer be usable. --- src/node/utxo_snapshot.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/node') diff --git a/src/node/utxo_snapshot.h b/src/node/utxo_snapshot.h index 4767d49889..61292cdcc5 100644 --- a/src/node/utxo_snapshot.h +++ b/src/node/utxo_snapshot.h @@ -22,22 +22,15 @@ public: //! during snapshot load to estimate progress of UTXO set reconstruction. uint64_t m_coins_count = 0; - //! Necessary to "fake" the base nChainTx so that we can estimate progress during - //! initial block download for the assumeutxo chainstate. - //! - //! TODO: this is unused and should be removed. - unsigned int m_nchaintx = 0; - SnapshotMetadata() { } SnapshotMetadata( const uint256& base_blockhash, uint64_t coins_count, unsigned int nchaintx) : m_base_blockhash(base_blockhash), - m_coins_count(coins_count), - m_nchaintx(nchaintx) { } + m_coins_count(coins_count) { } - SERIALIZE_METHODS(SnapshotMetadata, obj) { READWRITE(obj.m_base_blockhash, obj.m_coins_count, obj.m_nchaintx); } + SERIALIZE_METHODS(SnapshotMetadata, obj) { READWRITE(obj.m_base_blockhash, obj.m_coins_count); } }; #endif // BITCOIN_NODE_UTXO_SNAPSHOT_H -- cgit v1.2.3