Add an information print when there's no blockchain
This commit is contained in:
parent
5b46248ff2
commit
54b6c07b6c
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/boltdb/bolt"
|
||||
|
@ -96,6 +97,7 @@ func NewBlockchain() *Blockchain {
|
|||
b := tx.Bucket([]byte(blocksBucket))
|
||||
|
||||
if b == nil {
|
||||
fmt.Println("No existing blockchain found. Creating a new one...")
|
||||
genesis := NewGenesisBlock()
|
||||
|
||||
b, err := tx.CreateBucket([]byte(blocksBucket))
|
||||
|
|
Loading…
Reference in New Issue