Skip to content
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

[bug] When sending out MAX amount (consolidation), an undesired 0 sats change output is created. #10

Open
jr21M opened this issue Feb 9, 2024 · 1 comment
Assignees

Comments

@jr21M
Copy link

jr21M commented Feb 9, 2024

Watchonly forces to add a change address, even when consolidating funds (i.e. when sending out the MAX amount). This makes transaction have an one output with 0 sats. Therefore they are dropped as dust by the mempool.

Expected behaviour:
When max amount is selected, no change address are created and transactions have only one output.

Running watchonly 0.22 with LNbits 0.12

@jr21M jr21M changed the title [bug] When sending out MAX amount (consolidation), a 0 sats change output is always created. Therefore txs are dropped as dust! [bug] When sending out MAX amount (consolidation), a 0 sats change output is created. Feb 9, 2024
@jr21M jr21M changed the title [bug] When sending out MAX amount (consolidation), a 0 sats change output is created. [bug] When sending out MAX amount (consolidation), an undesired 0 sats change output is created. Feb 9, 2024
@jr21M
Copy link
Author

jr21M commented Feb 14, 2024

I think there is something wrong with this bit in the payment.js. There should never be an outputs when the diffAmount is 0. But for some reason it nonetheless gets created.

if (!excludeChange) { const change = this.createChangeOutput() const diffAmount = this.selectedAmount - this.totalPayedAmount if (diffAmount >= this.DUST_LIMIT) { tx.outputs.push(change) }

@motorina0 motorina0 self-assigned this Feb 14, 2024
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

No branches or pull requests

2 participants