Auto merge of #5241 - nuttycom:consensus/check_orchard_root_bottom, r=daira
Consensus: Add check to ensure that the Orchard commitment tree is not overfull after AppendBundle. Part of #5197.
This commit is contained in:
commit
81da4f92ab
|
@ -3238,7 +3238,11 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
|||
sapling_tree.append(outputDescription.cmu);
|
||||
}
|
||||
|
||||
orchard_tree.AppendBundle(tx.GetOrchardBundle());
|
||||
if (!orchard_tree.AppendBundle(tx.GetOrchardBundle())) {
|
||||
return state.DoS(100,
|
||||
error("ConnectBlock(): block would overfill the Orchard commitment tree."),
|
||||
REJECT_INVALID, "orchard-commitment-tree-full");
|
||||
};
|
||||
|
||||
if (!(tx.vShieldedSpend.empty() && tx.vShieldedOutput.empty())) {
|
||||
total_sapling_tx += 1;
|
||||
|
|
Loading…
Reference in New Issue