-
Notifications
You must be signed in to change notification settings - Fork 390
Add canonicalization modifier: assume not canonical. #1809
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
Conversation
Introduce `CanonicalizationMods` which is passed in to `CanonicalIter::new`. `CanonicalizationMods::assume_canonical` is the only field right now. This contains a list of txids that we assume to be canonical, superceding any other canonicalization rules.
Also change `TxTemplate` API to allow for testing with `assume_canonical`.
This is useful for crafting RBF transactions where you do not want to pick inputs from txs you are replacing or descendants of txs you are replacing.
As in #1808 it would be nice to have a draft PR that uses this to clean up RBF in wallet to see if we've got everything we need here. |
Took this out of the |
I've realized there's a flaw with the Consider a case where transaction Since this feature is intended to support RBF behavior, this logic doesn't actually help us. The correct assume_not_spent: HashSet<OutPoint>, |
Description
This is useful for creating RBF transactions where you do not want to spend from txs you are replacing or descendants of txs you are replacing.
I noticed that some users think it is useful to implicitly cancel a tx. This can also be used for that. cc. #1799, #1764.
Notes to the reviewers
This PR is based on #1808. Please review and merge that first.
Changelog notice
WIP
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features: