diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 3e4c085c0edba..f38c015f6d7ab 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -814,9 +814,11 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) CAmount nDustThreshold = 182 * g_dust.GetFeePerK() / 1000; BOOST_CHECK_EQUAL(nDustThreshold, 546); - // Add dust output to take dust slot, still standard! - t.vout.emplace_back(0, t.vout[0].scriptPubKey); - CheckIsStandard(t); + // Add dust outputs up to allowed maximum, still standard! + for (size_t i{0}; i < MAX_DUST_OUTPUTS_PER_TX; ++i) { + t.vout.emplace_back(0, t.vout[0].scriptPubKey); + CheckIsStandard(t); + } // dust: t.vout[0].nValue = nDustThreshold - 1; @@ -974,9 +976,9 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) CheckIsNotStandard(t, "bare-multisig"); g_bare_multi = DEFAULT_PERMIT_BAREMULTISIG; - // Add dust output to take dust slot + // Add dust outputs up to allowed maximum assert(t.vout.size() == 1); - t.vout.emplace_back(0, t.vout[0].scriptPubKey); + t.vout.insert(t.vout.end(), MAX_DUST_OUTPUTS_PER_TX, {0, t.vout[0].scriptPubKey}); // Check compressed P2PK outputs dust threshold (must have leading 02 or 03) t.vout[0].scriptPubKey = CScript() << std::vector(33, 0x02) << OP_CHECKSIG;