aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@gmail.com>2019-04-25 11:09:29 -0400
committerJames O'Beirne <james.obeirne@pm.me>2021-02-12 07:53:22 -0600
commit7a6c46b37edb8bfa0085d202aa7e9427d5e4fceb (patch)
tree68f691ce5fec4b11dc22465db1ac82b25662f128 /src/node
parente9c037ba64dd5b073fccf059ef75db1c97abd0bd (diff)
downloadbitcoin-7a6c46b37edb8bfa0085d202aa7e9427d5e4fceb.tar.xz
chainparams: add allowed assumeutxo values
Values for mainnet and testnet will be specified in a follow-up PR that can be scrutinized accordingly. This structure is required for use in snapshot activation logic.
Diffstat (limited to 'src/node')
-rw-r--r--src/node/coinstats.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/node/coinstats.cpp b/src/node/coinstats.cpp
index b994e79391..06fcc33725 100644
--- a/src/node/coinstats.cpp
+++ b/src/node/coinstats.cpp
@@ -55,6 +55,18 @@ static void ApplyHash(CCoinsStats& stats, MuHash3072& muhash, const uint256& has
muhash.Insert(MakeUCharSpan(ss));
}
+//! Warning: be very careful when changing this! assumeutxo and UTXO snapshot
+//! validation commitments are reliant on the hash constructed by this
+//! function.
+//!
+//! If the construction of this hash is changed, it will invalidate
+//! existing UTXO snapshots. This will not result in any kind of consensus
+//! failure, but it will force clients that were expecting to make use of
+//! assumeutxo to do traditional IBD instead.
+//!
+//! It is also possible, though very unlikely, that a change in this
+//! construction could cause a previously invalid (and potentially malicious)
+//! UTXO snapshot to be considered valid.
template <typename T>
static void ApplyStats(CCoinsStats& stats, T& hash_obj, const uint256& hash, const std::map<uint32_t, Coin>& outputs)
{