Add an information print when there's no blockchain

This commit is contained in:
Ivan Kuznetsov 2017-08-29 16:27:33 +07:00
parent 5b46248ff2
commit 54b6c07b6c
1 changed files with 2 additions and 0 deletions

View File

@ -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))