Closed cassiniNMC closed 6 years ago
You can set -debug=names
or just -debug
to see some more information, but I'm not sure how useful it will be. I would probably try inserting log/printf statements into the code to dig deeper, but maybe that's what you mean by "setting up an IDE".
BTW, have you also tried with the dev
branch?
BTW, have you also tried with the dev branch?
Meanwhile I built https://github.com/namecoin/namecoin-core/commit/23c9c5485cd2d4e38ca7744063551631409d0bda (dev
branch) and made the sendtoaddress experiment again using a fresh wallet. After precisely 25 transactions I run into the same problem. However, this build gives me a better error message:
CommitTransaction(): Transaction cannot be broadcast immediately, too-long-mempool-chain
Now guess what, Bitcoin Core has the same issue: https://github.com/bitcoin/bitcoin/issues/10004
Seems we need to recommend users they should try the -walletrejectlongchains=
parameter in this situation. Pull request https://github.com/bitcoin/bitcoin/pull/10015 should solve this issue in the near future.
I don't think there is anything we can do here on the Namecoin side - that is something to be solved (or not) upstream in Bitcoin.
Randy Waterhouse reported a sporadic error code -4 effect a while ago, see observation # 3 in https://github.com/namecoin/namecoin-core/pull/67#issuecomment-214625262
The full error text is: error code: -4 error message: Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of the wallet and coins were spent in the copy but not marked as spent here.
In this situation there is one unusual entry in debug.log: CommitTransaction(): Error: Transaction not valid
Meanwhile I experienced the same issue with name_update operations using a build from November 2016. I made several more tests and could reproduce this error at a rate of about 1 in 50 name operations when issuing the transactions every 15 seconds. Sending tx operations twice as fast (every 7.5 s) seems to increase the error rate slightly.
Then I built https://github.com/namecoin/namecoin-core/commit/5d526c4566c1e2a961687232e794bf1a1d2eb1cc (no GUI). Same error rate here (using a wallet that I created about 1 year ago; has never been encrypted)
Another experiment with this build: I tried 50 sendtoaddress operations to different addresses of a different wallet. After around 40 successful transactions I got that error code -4 again.
On all these occasions these symptoms are identical: (1) The UTXO amount gets frozen somehow. This is the effect Randy Waterhouse described as "something weird with tying up coins". If this was the only UTXO in the wallet, for example, it looks as if all the NMCs have disappeared all of a sudden (getinfo, getbalance, getwalletinfo etc.) (2) The tx shows up in the listtransactions output but gets not included in the mempool. It is not being sent to the network. (3) The listtransactions output looks as usual with two exceptions: a) "trusted": false, and b) "bip125-replaceable": "unknown" (4) After an abandontransaction on this tx the UTXO gets released. Another attempt issueing the identical name_update or sendtoaddress operation as before is then successful.
Next step: I'll create a new wallet, get me some NMCs from an exchange, and do the senttoaddress experiment again. Any ideas how I can get more info on the internal client status during that error without setting up an IDE? Maybe a special -debug= setting or similar?