namecoin / electrum-nmc

Namecoin port of Electrum Bitcoin client.
https://www.namecoin.org/
MIT License
29 stars 24 forks source link

sequenced name_updates fails #309

Open RyuMaster opened 2 years ago

RyuMaster commented 2 years ago

If I sent one name_update after another, electrum returns 500 error for the second one, only first name_update is being executed Both only works, if I have decent-enough delay between, like 3 seconds or more.

Is it something I need to configure additionally?

JeremyRand commented 2 years ago

Are you using the broadcast command by itself to send the transactions, or are you also using addtransaction? There is an undocumented race condition in upstream Electrum; the former will only result in your wallet learning about the transaction after the server reports it, which would explain your 3-second minimum. If that's the cause, let me know and I can look into documenting this upstream.

domob1812 commented 2 years ago

We are using broadcast, so that explains it indeed. Thanks for pointing this out! If we change that to addtransaction, will that automatically broadcast, or do we need to do both of them?

JeremyRand commented 2 years ago

You need to do both; see the implementation of the name_autoregister command for an example. Thanks for confirming this is the cause; I'll check with upstream about documenting this better. (I'll leave this issue open until the documentation is fixed.)