From 50e05ae1bab76e1d6c3a2330fbab6ac9ede51961 Mon Sep 17 00:00:00 2001 From: vyzo Date: Thu, 14 May 2020 19:29:36 +0300 Subject: [PATCH] use sigs.CheckBlockSignature --- chain/sub/incoming.go | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/chain/sub/incoming.go b/chain/sub/incoming.go index 9e4f68f77..3bf42f1c2 100644 --- a/chain/sub/incoming.go +++ b/chain/sub/incoming.go @@ -200,15 +200,7 @@ func (bv *BlockValidator) Validate(ctx context.Context, pid peer.ID, msg *pubsub } } - blob, err := blk.Header.SigningBytes() - if err != nil { - // this shouldn't happen; it's an encoding error of the object we just decoded sans the - // signature... - log.Errorf("error retrieving signing bytes for block header: %s", err) - return pubsub.ValidationIgnore - } - - err = sigs.Verify(blk.Header.BlockSig, key, blob) + err = sigs.CheckBlockSignature(blk.Header, ctx, key) if err != nil { log.Errorf("block signature verification failed: %s", err) recordFailure("signature_verification_failed")