steem
steem copied to clipboard
Cleanup 0 SMT Balances Lazily
SMT Balances are actively cleaned up when they are at 0.
Calling functions to modify_balance might not be aware that the balance object is about to be deleted when calling in to it. Other objects do not behave in this manner and are either directly removed by the code dealing with them (explicitly via remove) or are removed optionally (votes on payouts), having to code in this manner is not engrained. To prevent such occurrences, balances objects should not be deleted immediately. Rather, they will be cleaned up lazily after a certain amount of time has passed with the balances being 0 (such as a week). All of this is non-consensus and should be minimally configurable via compile time constants.