File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 33// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44
55#include < arith_uint256.h>
6+ #include < consensus/validation.h>
7+ #include < policy/policy.h>
68#include < primitives/transaction.h>
79#include < pubkey.h>
810#include < script/sign.h>
911#include < script/signingprovider.h>
1012#include < test/util/random.h>
1113#include < test/util/setup_common.h>
14+ #include < test/util/transaction_utils.h>
1215#include < txorphanage.h>
1316
1417#include < array>
@@ -370,4 +373,21 @@ BOOST_AUTO_TEST_CASE(get_children)
370373 }
371374}
372375
376+ BOOST_AUTO_TEST_CASE (too_large_orphan_tx)
377+ {
378+ TxOrphanage orphanage;
379+ CMutableTransaction tx;
380+ tx.vin .resize (1 );
381+
382+ // check that txs larger than MAX_STANDARD_TX_WEIGHT are not added to the orphanage
383+ BulkTransaction (tx, MAX_STANDARD_TX_WEIGHT + 4 );
384+ BOOST_CHECK_EQUAL (GetTransactionWeight (CTransaction (tx)), MAX_STANDARD_TX_WEIGHT + 4 );
385+ BOOST_CHECK (!orphanage.AddTx (MakeTransactionRef (tx), 0 ));
386+
387+ tx.vout .clear ();
388+ BulkTransaction (tx, MAX_STANDARD_TX_WEIGHT);
389+ BOOST_CHECK_EQUAL (GetTransactionWeight (CTransaction (tx)), MAX_STANDARD_TX_WEIGHT);
390+ BOOST_CHECK (orphanage.AddTx (MakeTransactionRef (tx), 0 ));
391+ }
392+
373393BOOST_AUTO_TEST_SUITE_END ()
You can’t perform that action at this time.
0 commit comments