From 6d6b66e33bae84526b21a4723794c1048ea0b695 Mon Sep 17 00:00:00 2001 From: daleboy <785909868@qq.com> Date: Thu, 15 Oct 2020 22:25:29 +0800 Subject: [PATCH] Update blockchain.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Edit the function NewBlockchain: 1.delete the parameter of the function,the parameter is not used. 2.fix the description of the function,the description is not right. --- blockchain.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blockchain.go b/blockchain.go index b9cfb42..d733bb5 100644 --- a/blockchain.go +++ b/blockchain.go @@ -183,8 +183,8 @@ func dbExists() bool { return true } -// NewBlockchain creates a new Blockchain with genesis Block -func NewBlockchain(address string) *Blockchain { +// NewBlockchain creates an Blockchain instance +func NewBlockchain() *Blockchain { if dbExists() == false { fmt.Println("No existing blockchain found. Create one first.") os.Exit(1) @@ -198,7 +198,7 @@ func NewBlockchain(address string) *Blockchain { err = db.Update(func(tx *bolt.Tx) error { b := tx.Bucket([]byte(blocksBucket)) - tip = b.Get([]byte("l")) + tip = b.Get([]byte("l"))//get the last block's hash return nil })