From 10078f39d6ae05086ffdbc4f3f35d17ac0b137a7 Mon Sep 17 00:00:00 2001 From: William Banfield Date: Wed, 18 May 2022 16:53:55 -0400 Subject: [PATCH] add nil check for block load --- internal/blocksync/reactor.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/blocksync/reactor.go b/internal/blocksync/reactor.go index 47d551030..71c403a2a 100644 --- a/internal/blocksync/reactor.go +++ b/internal/blocksync/reactor.go @@ -202,7 +202,9 @@ func (r *Reactor) respondToPeer(ctx context.Context, msg *bcproto.BlockRequest, extCommit = r.store.LoadBlockExtendedCommit(msg.Height) } else { c := r.store.LoadBlockCommit(msg.Height) - extCommit = c.WrappedExtendedCommit() + if extCommit != nil { + extCommit = c.WrappedExtendedCommit() + } } if extCommit == nil { return fmt.Errorf("found block in store with no commit and no extended commit: %v", block)