core: remove named return variable from addHeaders()

This commit is contained in:
Roman Khimov 2020-09-16 17:45:12 +03:00
parent 6bffa811d4
commit 61ad82160b

View file

@ -444,10 +444,11 @@ func (bc *Blockchain) AddHeaders(headers ...*block.Header) error {
// addHeaders is an internal implementation of AddHeaders (`verify` parameter // addHeaders is an internal implementation of AddHeaders (`verify` parameter
// tells it to verify or not verify given headers). // 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 ( var (
start = time.Now() start = time.Now()
batch = bc.dao.Store.Batch() batch = bc.dao.Store.Batch()
err error
) )
if len(headers) > 0 { if len(headers) > 0 {
@ -471,7 +472,7 @@ func (bc *Blockchain) addHeaders(verify bool, headers ...*block.Header) (err err
} }
for _, h := range headers { for _, h := range headers {
if err = bc.verifyHeader(h, lastHeader); err != nil { if err = bc.verifyHeader(h, lastHeader); err != nil {
return return err
} }
lastHeader = h lastHeader = h
} }