dtr-org / unit-e

A digital currency for a new era of decentralized trust
https://unit-e.io
MIT License
45 stars 15 forks source link

Allow finalizer to bootstrap from deposit rescan #881

Closed Gnappuraz closed 5 years ago

Gnappuraz commented 5 years ago

Currently a finalizer that already deposited but looses its folder will fail to correctly bootstrap.

The code in WalletExtension::AddToWalletIfInvolvingMe(), to increment the state automata will expect the node to be already in the state +esperanza::ValidatorState::Phase::WAITING_DEPOSIT_CONFIRMATION, this will not happen if we haven't initialized the deposit manually (i.e. we are syncing after losing the data folder).

This PR fixes this issue allowing for a finalizer to be in the state +esperanza::ValidatorState::Phase::NOT_VALIDATING when checking this.

dsaveliev commented 5 years ago

utACK d759976843b43cd16e2e66d18aa321b1002fd229