From a5e867ffc4de1a70ad49d343ae8b58683ac4754b Mon Sep 17 00:00:00 2001 From: chris erway Date: Thu, 17 Feb 2022 13:07:15 -0500 Subject: [PATCH] clear all VotingData{} in ledgercore.AccountData.ClearOnlineState() and remove dead basics.AccountData.ClearOnlineState() --- data/basics/userBalance.go | 10 ---------- ledger/ledgercore/accountdata.go | 6 +----- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/data/basics/userBalance.go b/data/basics/userBalance.go index 66e8093f7f..36d83cf955 100644 --- a/data/basics/userBalance.go +++ b/data/basics/userBalance.go @@ -412,16 +412,6 @@ func MakeAccountData(status Status, algos MicroAlgos) AccountData { return AccountData{Status: status, MicroAlgos: algos} } -// ClearOnlineState resets the account's fields to indicate that the account is an offline account -func (u *AccountData) ClearOnlineState() { - u.Status = Offline - u.VoteFirstValid = Round(0) - u.VoteLastValid = Round(0) - u.VoteKeyDilution = 0 - u.VoteID = crypto.OneTimeSignatureVerifier{} - u.SelectionID = crypto.VRFVerifier{} -} - // Money returns the amount of MicroAlgos associated with the user's account func (u AccountData) Money(proto config.ConsensusParams, rewardsLevel uint64) (money MicroAlgos, rewards MicroAlgos) { e := u.WithUpdatedRewards(proto, rewardsLevel) diff --git a/ledger/ledgercore/accountdata.go b/ledger/ledgercore/accountdata.go index 789750a97f..b452b95482 100644 --- a/ledger/ledgercore/accountdata.go +++ b/ledger/ledgercore/accountdata.go @@ -123,11 +123,7 @@ func (u AccountData) WithUpdatedRewards(proto config.ConsensusParams, rewardsLev // ClearOnlineState resets the account's fields to indicate that the account is an offline account func (u *AccountData) ClearOnlineState() { u.Status = basics.Offline - u.VoteFirstValid = basics.Round(0) - u.VoteLastValid = basics.Round(0) - u.VoteKeyDilution = 0 - u.VoteID = crypto.OneTimeSignatureVerifier{} - u.SelectionID = crypto.VRFVerifier{} + u.VotingData = VotingData{} } // MinBalance computes the minimum balance requirements for an account based on