-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
lnwallet/btcwallet: remove invalid transactions from the wallet when broadcast fails #2671
lnwallet/btcwallet: remove invalid transactions from the wallet when broadcast fails #2671
Conversation
There are two cases left which I cannot determine if they should also be ignoring Line 195 in 8a0d0ec
Line 650 in 8a0d0ec
cc @joostjager |
Yes, they should be ignoring. The mechanism in sweeper is that it often tries to publish and if it is a double spend, it keeps retrying with exponential randomized back-off. This is to avoid making all kinds of mempool assumptions in the sweeper why a tx might be a double spend. |
Even though the first case that you refer to is rebroadcasting an exact tx of ours, it may still be that it fails because there is a conflict. |
a777e21
to
ce78399
Compare
Needs a rebase now that the dependent PR is in. |
Will rebase this after we've caught up lnd with btcwallet and neutrino. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! LGTM after dependency update 👍
The checks to determine whether the transaction broadcast failed due to it already existing in the mempool/chain are no longer needed since the underlying btcwallet PublishTransaction call will not return an error when running into these cases.
In this commit, we address a lingering issue within some subsystems that are responsible for broadcasting transactions. Previously, ErrDoubleSpend indicated that a transaction was already included in the mempool/chain. This error was then modified to actually be returned for conflicting transactions, but its callers were not modified accordingly. This would lead to conflicting transactions to be interpreted as valid, when they shouldn't be.
Needs rebase now that the dep PR has been merged. |
ce78399
to
7946d0a
Compare
Rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🎮
In this PR, we update our btcwallet dependency to the latest version, which includes some minor improvements to our error handling when broadcasting transactions.
Along the way, we also address a lingering issue within some subsystems that are responsible for broadcasting transactions. Previously, ErrDoubleSpend indicated that a transaction was already included in the mempool/chain. This error was then modified to actually be returned for conflicting transactions, but its callers were not modified accordingly. This would lead to conflicting transactions to be interpreted as valid, when they shouldn't be.
Depends on btcsuite/btcwallet#597.
Fixes #2657.