diff --git a/src/main.cpp b/src/main.cpp index 957b54495..53d073979 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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;