Update blockchain.go
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.
This commit is contained in:
parent
bf64f33069
commit
6d6b66e33b
|
@ -183,8 +183,8 @@ func dbExists() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBlockchain creates a new Blockchain with genesis Block
|
// NewBlockchain creates an Blockchain instance
|
||||||
func NewBlockchain(address string) *Blockchain {
|
func NewBlockchain() *Blockchain {
|
||||||
if dbExists() == false {
|
if dbExists() == false {
|
||||||
fmt.Println("No existing blockchain found. Create one first.")
|
fmt.Println("No existing blockchain found. Create one first.")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -198,7 +198,7 @@ func NewBlockchain(address string) *Blockchain {
|
||||||
|
|
||||||
err = db.Update(func(tx *bolt.Tx) error {
|
err = db.Update(func(tx *bolt.Tx) error {
|
||||||
b := tx.Bucket([]byte(blocksBucket))
|
b := tx.Bucket([]byte(blocksBucket))
|
||||||
tip = b.Get([]byte("l"))
|
tip = b.Get([]byte("l"))//get the last block's hash
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue