From 61ad82160bd0a90176128bc8896c94b0c1f218f0 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 16 Sep 2020 17:45:12 +0300 Subject: [PATCH] core: remove named return variable from addHeaders() --- pkg/core/blockchain.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index 01a48e92a..449dca250 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -444,10 +444,11 @@ func (bc *Blockchain) AddHeaders(headers ...*block.Header) error { // addHeaders is an internal implementation of AddHeaders (`verify` parameter // tells it to verify or not verify given headers). -func (bc *Blockchain) addHeaders(verify bool, headers ...*block.Header) (err error) { +func (bc *Blockchain) addHeaders(verify bool, headers ...*block.Header) error { var ( start = time.Now() batch = bc.dao.Store.Batch() + err error ) if len(headers) > 0 { @@ -471,7 +472,7 @@ func (bc *Blockchain) addHeaders(verify bool, headers ...*block.Header) (err err } for _, h := range headers { if err = bc.verifyHeader(h, lastHeader); err != nil { - return + return err } lastHeader = h }