Skip to content
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

Transactions rejected with error code -4, and UTXO frozen #150

Closed
cassiniNMC opened this issue Apr 2, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@cassiniNMC
Copy link

commented Apr 2, 2017

Randy Waterhouse reported a sporadic error code -4 effect a while ago, see observation # 3 in #67 (comment)

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 5d526c4
(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?

@domob1812

This comment has been minimized.

Copy link

commented Apr 2, 2017

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?

@cassiniNMC

This comment has been minimized.

Copy link
Author

commented Apr 9, 2017

BTW, have you also tried with the dev branch?

Meanwhile I built 23c9c54 (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: bitcoin/bitcoin#10004
Seems we need to recommend users they should try the -walletrejectlongchains= parameter in this situation. Pull request bitcoin/bitcoin#10015 should solve this issue in the near future.

@domob1812

This comment has been minimized.

Copy link

commented Jun 7, 2018

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.

@domob1812 domob1812 closed this Jun 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.