mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-23 14:10:15 +01:00
policy: Add OP_1 <0x4e73> as a standard output type
These outputs are called anchors, and allow key-less anchor spends which are vsize-minimized versus keyed anchors which require larger outputs when creating and inputs when spending.
This commit is contained in:
@@ -1026,6 +1026,14 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
|
||||
t.vout[0].nValue = 239;
|
||||
CheckIsNotStandard(t, "dust");
|
||||
}
|
||||
|
||||
// Check anchor outputs
|
||||
t.vout[0].scriptPubKey = CScript() << OP_1 << std::vector<unsigned char>{0x4e, 0x73};
|
||||
BOOST_CHECK(t.vout[0].scriptPubKey.IsPayToAnchor());
|
||||
t.vout[0].nValue = 240;
|
||||
CheckIsStandard(t);
|
||||
t.vout[0].nValue = 239;
|
||||
CheckIsNotStandard(t, "dust");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user