From db03671ad0a108df5a51e1428d83391a14cf3533 Mon Sep 17 00:00:00 2001 From: Jeff Winkler Date: Sun, 7 Nov 2021 00:23:05 -0500 Subject: [PATCH] Update common.go --- consensus/hotstuff/verification/common.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/consensus/hotstuff/verification/common.go b/consensus/hotstuff/verification/common.go index 0fafe85615b..86afe9173f3 100644 --- a/consensus/hotstuff/verification/common.go +++ b/consensus/hotstuff/verification/common.go @@ -100,7 +100,7 @@ func (s *stakingKeysAggregator) getCurrent() *aggregate { return (*aggregate)(atomic.LoadPointer(&s.current)) } -// periodically and sets aggregate struct as current using this function. +// periodically sets aggregate struct as current func (s *stakingKeysAggregator) updateCurrent(agg *aggregate) { atomic.StorePointer(&s.current, unsafe.Pointer(agg)) } @@ -145,6 +145,7 @@ func (s *stakingKeysAggregator) aggregatedStakingKey(signers flow.IdentityList) lastStakingKey: updatedKey, } + // swap the struct out s.updateCurrent(nextInner) return updatedKey, nil