add and fix tests

pull/5/head
Minh Doan 7 years ago
parent d65fb29835
commit cf56cdbb0a
  1. 3
      blockchain/blockchain.go
  2. 4
      blockchain/utxopool.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
}

@ -1,6 +1,8 @@
package blockchain
import "encoding/hex"
import (
"encoding/hex"
)
// UTXOPool stores transactions and balance associated with each address.
type UTXOPool struct {

Loading…
Cancel
Save