OutCast3k / coinbin

Javascript Bitcoin Wallet. Supports Multisig, Stealth, HD, SegWit, Bech32, Time Locked Addresses, RBF and more!
https://coinb.in/
MIT License
909 stars 624 forks source link

Intended RBF transaction failing with 409 #222

Open halbano opened 3 years ago

halbano commented 3 years ago

Screen Shot 2021-02-01 at 02 45 26

Hey coinbin team,

I am facing an issue trying to increase the fees, by mistake I have sent a transaction with zero fee and it has been stuck on the dogecoin blockchain for a while. I am trying to run a RFB transaction by using the same parameters I have used in the original (zero fee) transaction. For some reason, the signed chunk fails when it is broadcasted with the error above.

Do you have any idea of what could be causing the issue? Is there any way to inspect this further? The 409 response is an empty JSON object {} btw

maxbethke commented 3 years ago

Looking at the error message it appears to me that you have used either blockchair or blockcypher. Most exchanges have problems with zero-fee transactions. Have you tried to push that transaction directly to blockcypher for example? => https://live.blockcypher.com/doge/pushtx/ Nontheless, there is no point in pushing a transaction with no fees, as it would never make it into a block anyways.

We could do some experimenting and find out how to display a more helpful error message. I dont have the resources right now, but will dig into this later.

halbano commented 3 years ago

Hey Max, thanks for your answer.

How the replacement (RBF) would work in this case? I have already solved the issue, the transaction went to the blockchain mempool, then failed and I have sent a new one with the proper fee. Actually I do agree that a more helpful error message if possible would be a good improvement.

maxbethke commented 3 years ago

The RBF 'flag' has to be set on the original transaction, telling the mempool that it is replaceable. coinbin sets that RBF flag by default. Did you change that? If not, the transaction should have been replaced.

I have already solved the issue, the transaction went to the blockchain mempool, then failed and I have sent a new one with the proper fee.

And if I understand you right, that is exactly what happened. The original transaction had the RBF flag set, which allowed it to get replaced by your 'new' transaction.

I think I need more clarification here:

With knowing the network used, I can look into under which circumstances it throws the error we see here.