Skip to content

wallet: allow mintxfee=0 #1333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

delta1
Copy link
Member

@delta1 delta1 commented May 22, 2024

Allow -mintxfee=0, so the elements wallet can create transactions with 0 value fee outputs.

Elements can already accept 0 value fees with -minrelaytxfee=0 and -blockmintxfee=0, but before this change the wallet would not create a transaction with 0 feerate.

Note: this check for 0 was inherited from upstream and subsequently removed in bitcoin/bitcoin@f11eb1f

This check for 0 feerate was inherited from upstream, and subsequently
removed in this commit:

bitcoin/bitcoin@f11eb1f
@delta1 delta1 requested a review from tomt1664 July 8, 2025 17:13
@delta1 delta1 marked this pull request as draft July 11, 2025 08:49
Copy link
Member

@tomt1664 tomt1664 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HasValidFee is a consensus check (in CheckTxInputs) which was introduced with CA.

I'm not sure why the fee == 0 was originally added, as a transaction without any fee output (i.e. also zero fee) is consensus valid. (the fee == 0 check in only applied to individual fee outputs, not the total fees for the tx).

I've verified that removing this fee == 0 check will cause a hard-fork if a zero fee output tx is confirmed in a block.

Suggestion: we add a -con_ config parameter (e.g. -con_allowanyfee) that removes this optionally.

@@ -30,8 +30,9 @@ bool HasValidFee(const CTransaction& tx) {
CAmount fee = 0;
if (tx.vout[i].IsFee()) {
fee = tx.vout[i].nValue.GetAmount();
if (fee == 0 || !MoneyRange(fee))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a hard fork?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so, thanks for catching this

@delta1
Copy link
Member Author

delta1 commented Jul 11, 2025

why the fee == 0 was originally added

I think that part was inherited from upstream initially

add a -con_ config parameter (e.g. -con_allowanyfee) that removes this optionally

Good idea, thanks

@tomt1664 tomt1664 mentioned this pull request Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants