-
Notifications
You must be signed in to change notification settings - Fork 70
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
Fix broken bumpfee method #42
Conversation
c7906a9
to
c63bd06
Compare
c63bd06
to
7b1855b
Compare
Rebased on master |
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 but I still need to manually test. Found a small typo that should be fixed.
7b1855b
to
1923fd4
Compare
Thanks. Updated.. |
I've tried manually testing and need to confirm my scenario is right,
But this gives me an error |
I think what is happening here is That's the intended behavior though. The wallet should not be able to reduce an outsider recipient's amount by bumping fee. It can only bumfee if its has a change output, or a single output with wallet internal address (in case of sweeping funds). Can you check the single output case with an address derived from the wallet? It worked for me as far as I remember.
I think the error message can be improved here. It could say "not allowed to reduce amount of non wallet address" or something like that. |
Thanks, ok yes it makes sense now that I couldn't reduce the output of an address I don't control. Is the purpose of this sort of transaction with all sats spent to one of my own wallet addresses be for some sort of UTXO consolidation? |
Yes mostly for utxo consolidation in the same wallet, or shifting the full balance from one wallet to another. But in the second case we can't bumpfee, because such sweeping transactions won't have a change. There the option is to CPFP the transaction from the recipient wallet to increase mining priority. I think I have an idea for selecting the wallet utxo automatically, now that we have In most of the cases the tx will have a change. And we can handle the special case of "send all funds to an outside address" with a dedicated error message. But not sure if that's too fancy for the bdk-cli tool. 😅 |
Sorry now that I'm looking at it closer, why can't we reduce the output amount for a single output to an address we can't control? In the pre- |
I think I have a better approach in #45, please take a look and let me know what you think. |
Closed in favor of #45 |
Description
This fixes the issue I pointed at bitcoindevkit/bdk#427. I found way around to get the
script_pubkey
for and output without a need ofget_tx()
function.Added one extra argument to
bump_fee
to select the utxo whose output is to be reduced.Notes to the reviewers
Please check the
bump_fee
function manually. I have checked them locally and it works. But there is no unit tests for these.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committing