-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Error "non-final" when broadcasting #8245
Comments
To confirm, are you calling the "broadcast" command of electrum, via RPC, when getting that error? Can you share the raw tx?
|
Maybe the server is lagging? we use We could use the server's height instead of |
Ah. Great point! I suggest using So I think we don't need to introduce the extra complication of broadcasting to other servers, just for this. diff --git a/electrum/wallet.py b/electrum/wallet.py
index b0db8b3e43..28c369fb6a 100644
--- a/electrum/wallet.py
+++ b/electrum/wallet.py
@@ -208,11 +208,17 @@ def get_locktime_for_new_transaction(network: 'Network') -> int:
if chain.is_tip_stale():
return 0
# discourage "fee sniping"
- locktime = chain.height()
+ # note: main server might be lagging
+ # (but if it's lagging too much, it is the network's job to switch away)
+ locktime = min(
+ chain.height(), # learnt from all connected servers, SPV-checked
+ network.get_server_height(), # height claimed by main server, unverified
+ )
# sometimes pick locktime a bit further back, to help privacy
# of setups that need more time (offline/multisig/coinjoin/...)
if random.randint(0, 9) == 0:
locktime = max(0, locktime - random.randint(0, 99))
+ locktime = max(0, locktime)
return locktime |
Yes, I use broadcast method.
Raw tx unfortunately I can't find it right now |
We have several servers where electrum is installed. This error is observed on half of them. |
By "server", the electrum server that the client is connected to was meant; not the machine running the client. |
I understand that you changed the algorithm and this error will not be from version 4.4.0? |
yes, should be fixed on master now |
Ubuntu, PHP. Use Electrum via JSON RPC.
Method "broadcast"
Sometimes I get an error: {"id": "curltext", "jsonrpc": "2.0", "error": {"code": 1, "message": "non-final"}}
What mean this error? 6 months work all good and never get this error. But now I get this error near 0.5% off all my send transactions.
The text was updated successfully, but these errors were encountered: