@@ -278,6 +278,24 @@ BOOST_FIXTURE_TEST_CASE(package_submission_tests, TestChain100Setup)
278
278
BOOST_CHECK (result_3gen_submit.m_package_feerate == std::nullopt);
279
279
}
280
280
281
+ // Parent and child package where transactions are invalid for reasons other than fee and
282
+ // missing inputs, so the package validation isn't expected to happen.
283
+ {
284
+ CScriptWitness bad_witness;
285
+ bad_witness.stack .push_back (std::vector<unsigned char >(1 ));
286
+ CMutableTransaction mtx_parent_invalid{mtx_parent};
287
+ mtx_parent_invalid.vin [0 ].scriptWitness = bad_witness;
288
+ CTransactionRef tx_parent_invalid = MakeTransactionRef (mtx_parent_invalid);
289
+ auto result_quit_early = ProcessNewPackage (m_node.chainman ->ActiveChainstate (), *m_node.mempool ,
290
+ {tx_parent_invalid, tx_child}, /* test_accept=*/ false );
291
+ BOOST_CHECK (result_quit_early.m_state .IsInvalid ());
292
+ BOOST_CHECK_EQUAL (result_quit_early.m_state .GetResult (), PackageValidationResult::PCKG_TX);
293
+ BOOST_CHECK (!result_quit_early.m_tx_results .empty ());
294
+ auto it_parent = result_quit_early.m_tx_results .find (tx_parent_invalid->GetWitnessHash ());
295
+ BOOST_CHECK (it_parent != result_quit_early.m_tx_results .end ());
296
+ BOOST_CHECK_EQUAL (it_parent->second .m_state .GetResult (), TxValidationResult::TX_WITNESS_MUTATED);
297
+ }
298
+
281
299
// Child with missing parent.
282
300
mtx_child.vin .push_back (CTxIn (COutPoint (package_unrelated[0 ]->GetHash (), 0 )));
283
301
Package package_missing_parent;
0 commit comments