Raise 100kB transaction size limit from Sapling activation
Closes #2864.
This commit is contained in:
11
src/main.cpp
11
src/main.cpp
@@ -943,6 +943,15 @@ bool ContextualCheckTransaction(const CTransaction& tx, CValidationState &state,
|
||||
}
|
||||
}
|
||||
|
||||
// Rules that apply before Sapling:
|
||||
if (!saplingActive) {
|
||||
// Size limits
|
||||
BOOST_STATIC_ASSERT(MAX_BLOCK_SIZE > MAX_TX_SIZE_BEFORE_SAPLING); // sanity
|
||||
if (::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION) > MAX_TX_SIZE_BEFORE_SAPLING)
|
||||
return state.DoS(100, error("ContextualCheckTransaction(): size limits failed"),
|
||||
REJECT_INVALID, "bad-txns-oversize");
|
||||
}
|
||||
|
||||
if (!(tx.IsCoinBase() || tx.vjoinsplit.empty())) {
|
||||
auto consensusBranchId = CurrentEpochBranchId(nHeight, Params().GetConsensus());
|
||||
// Empty output script.
|
||||
@@ -1051,7 +1060,7 @@ bool CheckTransactionWithoutProofVerification(const CTransaction& tx, CValidatio
|
||||
REJECT_INVALID, "bad-txns-vout-empty");
|
||||
|
||||
// Size limits
|
||||
BOOST_STATIC_ASSERT(MAX_BLOCK_SIZE > MAX_TX_SIZE); // sanity
|
||||
BOOST_STATIC_ASSERT(MAX_BLOCK_SIZE >= MAX_TX_SIZE); // sanity
|
||||
if (::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION) > MAX_TX_SIZE)
|
||||
return state.DoS(100, error("CheckTransaction(): size limits failed"),
|
||||
REJECT_INVALID, "bad-txns-oversize");
|
||||
|
||||
Reference in New Issue
Block a user