Follow-up from "Account Persistence"
The following discussion from !4422 (merged) should be addressed:
-
@DavidVorick started a discussion: (+1 comment) I'm not sure where to put this comment, it's a f/u for sure but I want to make sure it doesn't get lost - somewhere during startup for accounts, we need to ask the hosts for the latest balances. This should probably actually happen when the worker gets created. Basically the worker always asks the host for a balance update. If the worker doesn't know what the balance is (because of an unclean shutdown), then the worker will trust whatever value the host says. If the worker does know (because of a clean shutdown), the worker should penalize the host if the host returns a balance lower than what the worker has.
The worker can do this because the host has been coded to favor telling the renter too much money is in the account in the event that the host has an unclean shutdown. The host should never accidentally represent too low of a balance for the renter.