IsStandardTx()
returns rejection reason "tx-size"
if the transaction weight is larger than MAX_STANDARD_TX_WEIGHT
(=400000 vbytes).
The function IsStandardTx() returns rejection reason "tx-size" if the
transaction weight is larger than MAX_STANDARD_TX_WEIGHT (=400000 vbytes).
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
820@@ -821,9 +821,29 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
821 BOOST_CHECK(!IsStandardTx(CTransaction(t), reason));
822 BOOST_CHECK_EQUAL(reason, "scriptsig-size");
823
824+ // Check tx-size (non-standard if transaction weight is > MAX_STANDARD_TX_WEIGHT)
825+ t.vin.clear();
826+ t.vin.resize(2438); // size per input (empty scriptSig): 41 bytes
827+ t.vout[0].scriptPubKey = CScript() << OP_RETURN << std::vector<unsigned char>(19, 0); // output size: 30 bytes
828+ // tx header: 12 bytes => 48 vbytes
GetTransactionWeight
does the right thing, and checking that IsStandardTx
does what we expect.
theStack
DrahtBot
Empact
instagibbs
Labels
Tests