@@ -814,9 +814,11 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
814
814
CAmount nDustThreshold = 182 * g_dust.GetFeePerK () / 1000 ;
815
815
BOOST_CHECK_EQUAL (nDustThreshold, 546 );
816
816
817
- // Add dust output to take dust slot, still standard!
818
- t.vout .emplace_back (0 , t.vout [0 ].scriptPubKey );
819
- CheckIsStandard (t);
817
+ // Add dust outputs up to allowed maximum, still standard!
818
+ for (size_t i{0 }; i < MAX_DUST_OUTPUTS_PER_TX; ++i) {
819
+ t.vout .emplace_back (0 , t.vout [0 ].scriptPubKey );
820
+ CheckIsStandard (t);
821
+ }
820
822
821
823
// dust:
822
824
t.vout [0 ].nValue = nDustThreshold - 1 ;
@@ -974,9 +976,9 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
974
976
CheckIsNotStandard (t, " bare-multisig" );
975
977
g_bare_multi = DEFAULT_PERMIT_BAREMULTISIG;
976
978
977
- // Add dust output to take dust slot
979
+ // Add dust outputs up to allowed maximum
978
980
assert (t.vout .size () == 1 );
979
- t.vout .emplace_back ( 0 , t.vout [0 ].scriptPubKey );
981
+ t.vout .insert (t. vout . end (), MAX_DUST_OUTPUTS_PER_TX, { 0 , t.vout [0 ].scriptPubKey } );
980
982
981
983
// Check compressed P2PK outputs dust threshold (must have leading 02 or 03)
982
984
t.vout [0 ].scriptPubKey = CScript () << std::vector<unsigned char >(33 , 0x02 ) << OP_CHECKSIG;
0 commit comments