Skip to content
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

When I Bump Fee, tx amount also changing. #124

Open
y-vnk opened this issue Jan 19, 2024 · 3 comments
Open

When I Bump Fee, tx amount also changing. #124

y-vnk opened this issue Jan 19, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@y-vnk
Copy link

y-vnk commented Jan 19, 2024

If I send 20$ with fee of 18$ to user "A", and I tried to bump fee to 40$. I am able to see change in amount (double the amount which i sent 40$) which I sent to user "A"

@y-vnk y-vnk closed this as completed Jan 19, 2024
@y-vnk y-vnk changed the title How can I enable RBF for the transaction? When I Bump Fee, tx amount also changing. Feb 4, 2024
@y-vnk y-vnk reopened this Feb 4, 2024
@y-vnk
Copy link
Author

y-vnk commented Feb 5, 2024

@BitcoinZavior
Can you please check and let me know anything else I need to implement or is there any issue from my end?
For Bumping fee, I am justing sending parameters feerate and txid.

` BumpFeeTxBuilder bumpFeeTxBuilder =
BumpFeeTxBuilder(txid: txid, feeRate: feeRate);

  bumpFeeTxBuilder.allowShrinking(address);
  bumpFeeTxBuilder.enableRbf();
  TxBuilderResult data = await bumpFeeTxBuilder.finish(wallet!);
  final response = await wallet.sign(psbt: data.psbt);

  String? bTxid = await broadcastTransaction(
    tx: PartiallySignedTransaction(psbtBase64: response.psbtBase64),
  );`

@BitcoinZavior
Copy link
Contributor

I was able to replace a tx using bumpfee, it did not create another transaction as you mentioned above.

Here is my old tx, it shows the replaced by tx as well: https://mempool.space/testnet/tx/9e768566c5d55a0db37c0242000fe4d5124dd932438af67baf2c3d3f2f517842

Below is the code used:

sendBumpfeeTx(
     Blockchain blockchain, Wallet wallet, String address, String txid) async {
   try {
     final feeRate = await blockchain.estimateFee(25);
     final txBuilder =
         BumpFeeTxBuilder(txid: txid, feeRate: 5);
      txBuilder.enableRbf();
     TxBuilderResult data = await txBuilder.finish(wallet);
     final sbt = await wallet.sign(psbt: data.psbt);
     final tx = await sbt.extractTx();
     await blockchain.broadcast(tx);
   } on Exception {
     rethrow;
   }
 }

@BitcoinZavior
Copy link
Contributor

BitcoinZavior commented Feb 13, 2024

Related to bitcoindevkit/bdk#1342

@BitcoinZavior BitcoinZavior added the bug Something isn't working label Feb 13, 2024
@BitcoinZavior BitcoinZavior self-assigned this Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants