From ee62d62aa80b0b0c9dd5f79692bac9aef00c14a0 Mon Sep 17 00:00:00 2001 From: Alvar Penning Date: Thu, 8 Aug 2019 19:53:07 +0200 Subject: [PATCH] PrimaryBlock: Reset CRC before recalculation --- bundle/primary_block.go | 1 + 1 file changed, 1 insertion(+) diff --git a/bundle/primary_block.go b/bundle/primary_block.go index 8a15a2e1..5f673786 100644 --- a/bundle/primary_block.go +++ b/bundle/primary_block.go @@ -86,6 +86,7 @@ func (pb *PrimaryBlock) SetCRCType(crcType CRCType) { // should not cause any errors. This method must be called both when creating // the block and when changing its CRC. func (pb *PrimaryBlock) calcualteCRC() error { + pb.CRC = nil return pb.MarshalCbor(new(bytes.Buffer)) }