From cf56cdbb0a00395da982ca1caae6fbe53c204829 Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Sat, 16 Jun 2018 14:40:35 -0700 Subject: [PATCH] add and fix tests --- blockchain/blockchain.go | 3 +-- blockchain/utxopool.go | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index 44e0f318c..69abb82a3 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -3,7 +3,6 @@ package blockchain import ( "bytes" "encoding/hex" - "fmt" ) // Blockchain keeps a sequence of Blocks @@ -155,9 +154,9 @@ func (bc *Blockchain) VerifyNewBlockAndUpdate(utxopool *UTXOPool, block *Block) } if utxopool != nil && !utxopool.VerifyAndUpdate(block.Transactions) { - fmt.Println("Minh2") return false } + bc.blocks = append(bc.blocks, block) return true } diff --git a/blockchain/utxopool.go b/blockchain/utxopool.go index d8b017537..399071488 100644 --- a/blockchain/utxopool.go +++ b/blockchain/utxopool.go @@ -1,6 +1,8 @@ package blockchain -import "encoding/hex" +import ( + "encoding/hex" +) // UTXOPool stores transactions and balance associated with each address. type UTXOPool struct {