Check Block Before Processing it (#4527)

* fix panic
* Update beacon-chain/sync/pending_blocks_queue.go
This commit is contained in:
Nishant Das
2020-01-13 23:09:22 +08:00
committed by prylabs-bulldozer[bot]
parent de2f1fbf5c
commit e286069b20

View File

@@ -51,6 +51,10 @@ func (r *Service) processPendingBlocks(ctx context.Context) error {
r.pendingQueueLock.RLock()
b := r.slotToPendingBlocks[uint64(s)]
// Skip if block does not exist.
if b == nil || b.Block == nil {
continue
}
inPendingQueue := r.seenPendingBlocks[bytesutil.ToBytes32(b.Block.ParentRoot)]
r.pendingQueueLock.RUnlock()