Better handling of remote commit confirmation in TxPublisher #1905
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is split in two independent commits.
In the first commit, we fix a (harmless) issue where we kept spawning
TxPublisher
actors to spend anchor outputs even when the commit tx was confirmed if the feerate was already high enough. This was spamming the logs for no reason (and spawning actors that immediately stopped themselves), we should instead check the status of the commit tx as the first precondition to spending anchor outputs.In the second commit, we call
bitcoind
'sabandontransaction
when 2nd-stage txs are evicted from the mempool because their parent is replaced (e.g. the remote commit tx is confirmed instead of our local commit tx). This ensures thebitcoind
wallet will not keep these obsolete transactions in its DB and reserve their inputs for no good reason.Fixes #1898