Skip to content

Commit 472ca34

Browse files
committed
CR: comment fixes
1 parent aae79b3 commit 472ca34

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ledger/acctdeltas.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,11 +1032,15 @@ func onlineAccountsNewRoundImpl(
10321032
prevAcct = updated
10331033
}
10341034
} else {
1035-
// "delete" by inserting a zero entry
10361035
if prevAcct.AccountData.IsVotingEmpty() && newAcct.IsVotingEmpty() {
10371036
// if both old and new are offline, ignore
1037+
// otherwise the following could happen:
1038+
// 1. there are multiple offline account deltas so all of them could be inserted
1039+
// 2. delta.oldAcct is often pulled from a cache that is only updated on new rows insert so
1040+
// it could pull a very old already deleted offline value resulting one more insert
10381041
continue
10391042
}
1043+
// "delete" by inserting a zero entry
10401044
var ref trackerdb.OnlineAccountRef
10411045
ref, err = writer.InsertOnlineAccount(data.address, 0, trackerdb.BaseOnlineAccountData{}, updRound, 0)
10421046
if err != nil {

0 commit comments

Comments
 (0)