Clean up bid replacements and output selection #34
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 makes bid replacements more robust: Generally, If tx1 spends bidout1 then later tx2 replaces tx1 by also spending bidout1 then bdk may use outputs from tx1 to fund tx2, even though tx2 is technically replacing tx1 resulting in
bad-txns-spends-conflicting-tx
We should avoid selecting unconfirmed outputs when doing tx replacements anyways as that could result in
replacement-adds-unconfirmed
from Bitcoin Core. BDK avoids this here during fee bumping.This PR also adds an additional safety check during bidout selection to avoid selecting any spaces that look like bidouts.