Skip to content

Commit

Permalink
clear all VotingData{} in ledgercore.AccountData.ClearOnlineState() a…
Browse files Browse the repository at this point in the history
…nd remove dead basics.AccountData.ClearOnlineState()
  • Loading branch information
cce committed Feb 17, 2022
1 parent ca46d03 commit a5e867f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
10 changes: 0 additions & 10 deletions data/basics/userBalance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 1 addition & 5 deletions ledger/ledgercore/accountdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a5e867f

Please sign in to comment.