|
|
|
@ -113,18 +113,19 @@ func (vc *viewChange) GetPreparedBlock(fbftlog *FBFTLog, hash [32]byte) ([]byte, |
|
|
|
|
vc.vcLock.RLock() |
|
|
|
|
defer vc.vcLock.RUnlock() |
|
|
|
|
|
|
|
|
|
if !vc.isM1PayloadEmpty() { |
|
|
|
|
block := fbftlog.GetBlockByHash(hash) |
|
|
|
|
if block != nil { |
|
|
|
|
encodedBlock, err := rlp.EncodeToBytes(block) |
|
|
|
|
if err != nil || len(encodedBlock) == 0 { |
|
|
|
|
vc.getLogger().Err(err).Msg("[GetPreparedBlock] Failed encoding prepared block") |
|
|
|
|
return vc.m1Payload, nil |
|
|
|
|
} |
|
|
|
|
return vc.m1Payload, encodedBlock |
|
|
|
|
if vc.isM1PayloadEmpty() { |
|
|
|
|
return nil, nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if block := fbftlog.GetBlockByHash(hash); block != nil { |
|
|
|
|
encodedBlock, err := rlp.EncodeToBytes(block) |
|
|
|
|
if err != nil || len(encodedBlock) == 0 { |
|
|
|
|
return nil, nil |
|
|
|
|
} |
|
|
|
|
return vc.m1Payload, encodedBlock |
|
|
|
|
} |
|
|
|
|
return vc.m1Payload, nil |
|
|
|
|
|
|
|
|
|
return nil, nil |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// GetM2Bitmap returns the nilBitmap as M2Bitmap
|
|
|
|
|