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

Getting UTXOs while node is syncing #406

Closed
readcash opened this issue Aug 19, 2020 · 1 comment
Closed

Getting UTXOs while node is syncing #406

readcash opened this issue Aug 19, 2020 · 1 comment

Comments

@readcash
Copy link

This bug is described in #400, it goes as follows:

  1. You get an UTXO,
  2. you send a transaction A,
  3. transaction goes to the network,
  4. node operator restarts the node,
  5. node starts to sync the mempool from the network,
  6. you get an UTXO (the same one!),
  7. you send a transaction B,
  8. BCHD accepts this transaction B, but does not accept transaction A from the network (since it believes it is a double-spend); the rest of the network does not accept transaction B, since the network already has a transaction A;

So, now you are in a nice little bubble, where you keep spending transactions that the rest of the network think are double-spends. Probably you continue doing it until restart or until a block arrives.

This is not a theoretical situation - we were having this daily, because @blockparty-sh's node was set to restart at approximately the same time we were sending funds. So, we were sending transactions A->B->{node restart}->C->D->E->F... now all of C->D->E->F are really invalid (not accepted by the network)... though BCHD reports them as valid and allows us to spend them.. we send notifications to 400 people (each tx has 100 outputs), a block comes, all their money is gone! We get 400 emails "You stole my money!"

@readcash
Copy link
Author

readcash commented Aug 19, 2020

One possible solution could be to actually save the mempool into an append-only file and re-reading it upon restart (disallowing any RPC functions while restoring the mempool). Just a suggestion, might not be the most optimal one.

Thanks!

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

1 participant