From 9d6cabd18ab032b34fcb2863b578015f2e2a4415 Mon Sep 17 00:00:00 2001 From: vyzo Date: Sat, 3 Jul 2021 12:08:40 +0300 Subject: [PATCH] if it's not a dag, it's not a block --- blockstore/splitstore/splitstore.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blockstore/splitstore/splitstore.go b/blockstore/splitstore/splitstore.go index cb4aae621..f04d18ec0 100644 --- a/blockstore/splitstore/splitstore.go +++ b/blockstore/splitstore/splitstore.go @@ -674,6 +674,10 @@ func (s *SplitStore) isVMCopyContext() bool { } func (s *SplitStore) isBlockHeader(c cid.Cid) (isBlock bool, err error) { + if c.Prefix().Codec != cid.DagCBOR { + return false, nil + } + err = s.view(c, func(data []byte) error { var hdr types.BlockHeader isBlock = hdr.UnmarshalCBOR(bytes.NewBuffer(data)) == nil