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

Feat/restart nonce better #9

Open

Conversation

Projects
None yet
2 participants
@SiddharthMalhotra
Copy link

commented Feb 21, 2019

If there are transactions in the queue and they have a nonce assigned and it does not match to the network nonce, then we need to discard these transactions

if txs.count() > 0:
raise HistoryDeleteNeeded("Cannot reset nonce as the database contains txs for {}. Delete database to restart.".format(service.address))
if txs.count() > 0 and reset_pending_tx = True:
service.delete_pending_broadcasts()

This comment has been minimized.

Copy link
@voith

voith Feb 25, 2019

Collaborator

We can't just blindly delete pending transactions. Transactions are created and broadcasted in a particular order.
It is quite possible that the earlier txs might succeed and the later ones will fail. In such case deleting txs and running the same command will force the creation of old ones that succeeded already. This is redundant and we should avoid it.

We should rather find a way to update nonce of all pending transactions in the order they were created.

@voith voith self-requested a review Mar 1, 2019

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.