Merge remote-tracking branch 'origin/v0.1.1-dev' into v0.1.2-dev

This commit is contained in:
Mike Zak 2020-01-28 11:35:21 +02:00
commit 25bdaeed31
2 changed files with 5 additions and 3 deletions

View File

@ -1992,7 +1992,10 @@ func New(config *Config) (*BlockDAG, error) {
if genesis == nil {
genesisBlock := util.NewBlock(dag.dagParams.GenesisBlock)
isOrphan, isDelayed, err := dag.ProcessBlock(genesisBlock, BFNone)
// To prevent the creation of a new err variable unintentionally so the
// defered function above could read err - declare isOrphan and isDelayed explicitly.
var isOrphan, isDelayed bool
isOrphan, isDelayed, err = dag.ProcessBlock(genesisBlock, BFNone)
if err != nil {
return nil, err
}

View File

@ -7,7 +7,6 @@ package ffldb
import (
"bytes"
"encoding/binary"
"encoding/hex"
"fmt"
"os"
"path/filepath"
@ -640,7 +639,7 @@ func (b *bucket) CreateBucket(key []byte) (database.Bucket, error) {
// Ensure bucket does not already exist.
bidxKey := bucketIndexKey(b.id, key)
if b.tx.hasKey(bidxKey) {
str := fmt.Sprintf("bucket %s already exists", hex.EncodeToString(bidxKey))
str := fmt.Sprintf("bucket %s already exists", string(bidxKey))
return nil, makeDbErr(database.ErrBucketExists, str, nil)
}