2

I have an automated system that sends BTC payments via Electrum for a client.

Now, it happens again and again that payments keep failing with "min relay fee not met" (RPC call failed: {"code":-32603,"message":"Server error: File \"/home/ubuntu/.local/lib/python3.6/site-packages/electrum/network.py\", line 871, in broadcast_transaction | electrum.network.TxBroadcastServerReturnedError: min relay fee not met\n"}) for minutes or hours, and later it will work again.

A few facts:

  • The fee is taken from Electrum's getfeerate with fee_method: 'eta' and fee_level: 1 (this is already increased from the previous value), and it's actually afterwards inflated by another 20% by my code.

  • At first I thought it's an issue with Electrum servers. Now I'm using my own ElectrumX instance, and it happens there as well (I didn't find any way to set a fee limit). I then read that it is related to custom settings of Bitcoin nodes, but I'm now using my own Bitcoin node with default settings.

  • An example of a failing transaction would be this one: https://www.blockchain.com/btc/tx/d45a03bade61a2306994afa52cfd0f7cac18ec6965ec0425ae2010937f3afbad << this is when the transaction was successfully sent a few hours ago, but previously, around 12 hours ago, it kept failing - with the same fee: 45.853 sat/B - 11.463 sat/WU - 225 bytes

If I look at bitcoinfees.earn.com I see the "normal" fees around 20 sat/B, yet the 45 sat/B TX didn't go through. Even if the fees had jumped a bit, it's not logical that I see transactions like this one being successfully broadcasted at a similar time at which mine continued to fail, with only 3 sat/B...

Do you have any ideas what I could do about this problem? Of course I could react on this error by increasing the fees incrementally but this would cause trouble with my calculations and also it doesn't seem logical that I would have to pay a fee of 100+ sat/B when there are TXs with <10 sat/B at the same time...

  • What is the total amount of the fee you get in the end? like you said the min relay fee policy is defined by each node and according to this the minimum fee amount out of the box in Bitcoin Core, since 0.9, is 1000 sats. – FKrauss Jan 15 at 15:06
  • 0.00010317 BTC. As shown above, this is an example that worked blockchain.com/btc/tx/… but the same TX was sent 12 hours prior and got the error. Also, this other example blockchain.com/btc/tx/… is a TX that succeeded with just 0.00000678 BTC fee... – CherryDT Jan 15 at 17:38
  • 1
    Mempool being full can cause low fee paying transactions to be rejected, or even dropped if they were accepted previously. If you pay min-relay-fee, and there's a spike in mempool size, you become the first to be affected by this problem :) Also, it means your size estimation code needs to be perfect - as if it underestimates the fee, being 1 satoshi off can be the difference in accepted/rejected! Most likely? maybe electrumx isn't giving you fresh information, or your code doesn't treat min-relay-fee as dynamic :) – karimkorun Jan 16 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.