[PBFT] refactor to new function in temp msg pool
hihiboss opened this issue · 1 comments
hihiboss commented
Component
consensus - pbft
Assignee
anyone
Detail
In state api, a logic which gets temp msg pool items, saves them to state's msg pool and removes all msg in temp msg pool is duplicated. So, refactor this logic to new function.
// todo : refact to new function (UpdateMsgPool)
for _, poolMsg := range s.tempPrevoteMsgPool.Get() {
if err := loadedState.PrevoteMsgPool.Save(&poolMsg); err != nil {
iLogger.Errorf(nil, "[PBFT] Saving prevote msg is failed - Error: [%s]")
}
}
s.tempPrevoteMsgPool.RemoveAllMsgs()
Reference
.
zeroFruit commented
@zeroFruit 코드 공부할겸 진행하겠습니다