mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
Merge bitcoin/bitcoin#29496: policy: bump TX_MAX_STANDARD_VERSION to 3
30a01134cd[doc] update bips.md for 431 (glozow)9dbe6a03f0[test] wallet uses CURRENT_VERSION which is 2 (glozow)539404fe0f[policy] make v3 transactions standard (glozow)052ede75af[refactor] use TRUC_VERSION in place of 3 (glozow) Pull request description: Make `nVersion=3` (which is currently nonstandard on mainnet) standard. Note that we will treat these transactions as Topologically Restricted Until Confirmation (TRUC). Spec is in BIP 431 and implementation is in #28948, #29306, and #29873 See #27463 for overall project tracking, and #29319 for information about relevance to cluster mempool. ACKs for top commit: sdaftuar: utACK30a01134cachow101: ACK30a01134cdinstagibbs: utACK30a01134cdmurchandamus: ACK30a01134cdismaelsadeeq: ACK30a01134cd🛰️ Tree-SHA512: 2a4aec0442c860e792a061d83e36483c1f1b426f946efbdf664c8db97a596e498b535707e1d3a900218429486ea69fd4552e3d476526a6883cbd5556c6534b48
This commit is contained in:
@@ -118,7 +118,7 @@ void CheckMempoolV3Invariants(const CTxMemPool& tx_pool)
|
||||
LOCK(tx_pool.cs);
|
||||
for (const auto& tx_info : tx_pool.infoAll()) {
|
||||
const auto& entry = *Assert(tx_pool.GetEntry(tx_info.tx->GetHash()));
|
||||
if (tx_info.tx->nVersion == 3) {
|
||||
if (tx_info.tx->nVersion == TRUC_VERSION) {
|
||||
// Check that special maximum virtual size is respected
|
||||
Assert(entry.GetTxSize() <= V3_MAX_VSIZE);
|
||||
|
||||
@@ -133,12 +133,12 @@ void CheckMempoolV3Invariants(const CTxMemPool& tx_pool)
|
||||
Assert(entry.GetTxSize() <= V3_CHILD_MAX_VSIZE);
|
||||
// All v3 transactions must only have v3 unconfirmed parents.
|
||||
const auto& parents = entry.GetMemPoolParentsConst();
|
||||
Assert(parents.begin()->get().GetSharedTx()->nVersion == 3);
|
||||
Assert(parents.begin()->get().GetSharedTx()->nVersion == TRUC_VERSION);
|
||||
}
|
||||
} else if (entry.GetCountWithAncestors() > 1) {
|
||||
// All non-v3 transactions must only have non-v3 unconfirmed parents.
|
||||
for (const auto& parent : entry.GetMemPoolParentsConst()) {
|
||||
Assert(parent.get().GetSharedTx()->nVersion != 3);
|
||||
Assert(parent.get().GetSharedTx()->nVersion != TRUC_VERSION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user