Skip to content

Commit eecd270

Browse files
committed
[POLICY] Allow dust anchor outputs
Anchor outputs are not yet required to be spent in same mempool package.
1 parent 4288e91 commit eecd270

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/policy/policy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ bool IsStandardTx(const CTransaction& tx, const std::optional<unsigned>& max_dat
141141
else if ((whichType == TxoutType::MULTISIG) && (!permit_bare_multisig)) {
142142
reason = "bare-multisig";
143143
return false;
144-
} else if (IsDust(txout, dust_relay_fee)) {
144+
} else if (whichType != TxoutType::ANCHOR && IsDust(txout, dust_relay_fee)) {
145145
reason = "dust";
146146
return false;
147147
}

src/test/transaction_tests.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,13 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
925925
t.vout[0].nValue = 239;
926926
CheckIsNotStandard(t, "dust");
927927
}
928+
929+
// Check anchor outputs allow dust
930+
t.vout[0].scriptPubKey = CScript() << OP_1;
931+
t.vout[0].nValue = 0;
932+
CheckIsStandard(t);
933+
t.vout[0].nValue = 1; // Not just 0
934+
CheckIsStandard(t);
928935
}
929936

930937
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)