Skip to content

Commit

Permalink
nil proof check in worker
Browse files Browse the repository at this point in the history
  • Loading branch information
ssd04 committed Dec 18, 2024
1 parent 5b4a098 commit 537eb34
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion consensus/spos/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,12 @@ func (wrk *Worker) AddReceivedHeaderHandler(handler func(data.HeaderHandler)) {

// ReceivedProof process the received proof, calling each received proof handler registered in worker instance
func (wrk *Worker) ReceivedProof(proofHandler consensus.ProofHandler) {
// TODO: add preliminary checks
if check.IfNilReflect(proofHandler) {
log.Trace("ReceivedProof: nil proof handler")
return
}

log.Trace("ReceivedProof:", "proof header", proofHandler.GetHeaderHash())

wrk.mutReceivedProofHandler.RLock()
for _, handler := range wrk.receivedProofHandlers {
Expand Down

0 comments on commit 537eb34

Please sign in to comment.