Ensure that the Orchard note commitment tree does not exceed its maximum size.

This commit is contained in:
Kris Nuttycombe 2021-07-06 10:54:14 -06:00
parent c34162d6dd
commit dcbbf43d8b
1 changed files with 5 additions and 1 deletions

View File

@ -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(): the Orchard commitment tree is full."),
REJECT_INVALID, "orchard-commitment-tree-full");
};
if (!(tx.vShieldedSpend.empty() && tx.vShieldedOutput.empty())) {
total_sapling_tx += 1;