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 3
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
4
5
5
#include < arith_uint256.h>
6
+ #include < consensus/validation.h>
7
+ #include < policy/policy.h>
6
8
#include < primitives/transaction.h>
7
9
#include < pubkey.h>
8
10
#include < script/sign.h>
9
11
#include < script/signingprovider.h>
10
12
#include < test/util/random.h>
11
13
#include < test/util/setup_common.h>
14
+ #include < test/util/transaction_utils.h>
12
15
#include < txorphanage.h>
13
16
14
17
#include < array>
@@ -370,4 +373,21 @@ BOOST_AUTO_TEST_CASE(get_children)
370
373
}
371
374
}
372
375
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
+
373
393
BOOST_AUTO_TEST_SUITE_END ()
You can’t perform that action at this time.
0 commit comments