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

Wallet balance vanishes after creating a few transactions in a row #570

Open
ihavenoface opened this issue Apr 10, 2021 · 6 comments
Open
Assignees

Comments

@ihavenoface
Copy link
Contributor

ihavenoface commented Apr 10, 2021

This appears to be reproduceable on 0.9.0 and 0.10.0 on both main and regtest.

Here's what I'm running the daemon (4c36519 without any modifications) with:

-regtest=1
-debug=1
-server=1
-printtoconsole=1
-listenonion=0
-rpcuser=rpc
-rpcpassword=rpc
-datadir=/tmp/peercoin
# peercoin-cli -regtest -rpcuser=rpc -rpcpassword=rpc $@
> peercoin-cli getnewaddress                                                                      
n2VHyqDvQdWDsUZYMLfkuaUf2F2N6UuuR7

> peercoin-cli generatetoaddress 1 n2VHyqDvQdWDsUZYMLfkuaUf2F2N6UuuR7
[
  "6d450849da988382581ee295fbea1cd145a56367f1ae50662e5633b2873dbf57"
]

> peercoin-cli generatetoaddress 100 miGqeufwCjqXnNZsjUri3rqkXhbUm9cAXi
[
  "5d4cf5cd184717ae19ccb95b4b5ac3106d6d88c05cb1e235a993b142e54ceba7",
  "6e14e2f4d0852e8d272e4c077ca40d5a0b2a6ac7afb080979437ae907afa6d0e",
  "2d481ac83b8be3182c5f5a5e06b9c84e273efd246003b35ea8e67ca8726d3649",
...

> peercoin-cli getbalance
9999.000000

> for i in $(seq 1 50); do peercoin-cli sendtoaddress miGqeufwCjqXnNZsjUri3rqkXhbUm9cAXi 0.01; done
ed0ef91bd1bd309b31f21fb5fa403bc270512f4f4e6767cad7f1988f443d5720
89131dfb4642b01f2c6d808d8196b7817f300762516f8315e6051c21c1682cdf
2ca0169251979f8344e045990db00a8536fb121f0763a770bec1c2fea112b11c
360e4ddb7ff90aaaf1883765f18232f80fd29b4ad55884e991ae9f9653d8247e
25efb497d427bec1456f4626e74c4e5ccd2a9172497ccaadf2a365583a603584
09cc7f01d8664d7cb5f6864505b1c3ac99a4dc0c3f9220e780bc909d31efb2ac
72ee7ce856d019ae819cce606079321947e7c023b9eada31129c23a277ee8a74
...
error code: -6
error message:
Insufficient funds

> peercoin-cli getbalance
0.000000

Generating a new block, running rescanblockchain, and then restarting the client appears to fix the issue.

Not sure if this is related, but testing on windows with the release provided here https://github.com/peercoin/peercoin/releases/tag/v0.10.0ppc.rc5 on main net gives me this:
image
image

This wallet had 25 peercoin in it at the start of the test.

@ihavenoface
Copy link
Contributor Author

ihavenoface commented Apr 22, 2021

I have found another way to trigger this bug:

  1. have a wallet with enough coin in it for it to stake soon
  2. put system in sleep mode for long enough for the stake to be highly likely
  3. wake up system and generate a valid block

In this case the wallet does not show the "immature" balance from the transaction, as it should, but 0 balance instead.

@ihavenoface
Copy link
Contributor Author

Looking into this further, it seems like I'm not the first one to run into this error, see bitcoin/bitcoin#10004 for reference.
Imho the present behavior is wrong and long mempool chains should be rejected by default.

Would there be any interest in a PR similar to bitcoin/bitcoin#10015?

@backpacker69
Copy link
Member

can you check with latest 0.11?

@ihavenoface
Copy link
Contributor Author

Same thing on 0.11.

@peerchemist
Copy link
Member

@ihavenoface is this still a thing?

@satoshi-n
Copy link

Yeah this issue broke my doge wallet in the past

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants