diff --git a/dot/core/service.go b/dot/core/service.go index cf72bdfe65..c7bce45155 100644 --- a/dot/core/service.go +++ b/dot/core/service.go @@ -284,12 +284,7 @@ func (s *Service) handleReceivedBlock(block *types.Block) (err error) { return ErrNilBlockState } - err = s.blockState.AddBlock(block) - if err != nil { - return err - } - - logger.Debug("added block from BABE", "header", block.Header, "body", block.Body) + logger.Debug("got block from BABE", "header", block.Header, "body", block.Body) msg := &network.BlockAnnounceMessage{ ParentHash: block.Header.ParentHash, diff --git a/lib/babe/babe.go b/lib/babe/babe.go index 8d640be386..072d22ada0 100644 --- a/lib/babe/babe.go +++ b/lib/babe/babe.go @@ -505,6 +505,11 @@ func (b *Service) handleSlot(slotNum uint64) error { logger.Info("built block", "hash", hash.String(), "number", block.Header.Number, "slot", slotNum) logger.Debug("built block", "header", block.Header, "body", block.Body, "parent", parent.Hash()) + err = b.blockState.AddBlock(block) + if err != nil { + return err + } + err = b.safeSend(*block) if err != nil { logger.Error("failed to send block to core", "error", err)