diff --git a/consensus/view_change_construct.go b/consensus/view_change_construct.go index 072a3efbb..c423d64aa 100644 --- a/consensus/view_change_construct.go +++ b/consensus/view_change_construct.go @@ -397,6 +397,9 @@ func (vc *viewChange) InitPayload( vc.getLogger().Warn().Str("key", key.Pub.Bytes.Hex()).Msg("[InitPayload] nilBitmap setkey failed") continue } + if _, ok := vc.nilSigs[viewID]; !ok { + vc.nilSigs[viewID] = map[string]*bls_core.Sign{} + } vc.nilSigs[viewID][key.Pub.Bytes.Hex()] = key.Pri.SignHash(NIL) } } @@ -421,6 +424,9 @@ func (vc *viewChange) InitPayload( vc.getLogger().Warn().Str("key", key.Pub.Bytes.Hex()).Msg("[InitPayload] viewIDBitmap setkey failed") continue } + if _, ok := vc.viewIDSigs[viewID]; !ok { + vc.viewIDSigs[viewID] = map[string]*bls_core.Sign{} + } vc.viewIDSigs[viewID][key.Pub.Bytes.Hex()] = key.Pri.SignHash(viewIDBytes) } }