func newBlockNode(blockHeader *wire.BlockHeader, blockHash *chainhash.Hash) *blockNode {
	prevHash := blockHeader.PrevBlock
	node := blockNode{
		hash:             blockHash,
		parentHash:       &prevHash,
		workSum:          CalcWork(blockHeader.Bits),
		height:           blockHeader.Height,
		version:          blockHeader.Version,
		bits:             blockHeader.Bits,
		nonce:            blockHeader.Nonce,
		timestamp:        blockHeader.Timestamp.Unix(),
		merkleRoot:       blockHeader.MerkleRoot,
		validatingPubKey: blockHeader.ValidatingPubKey,
	}
	return &node
}
newBlockNode returns a new block node for the given block header.  It is
completely disconnected from the chain and the workSum value is just the work
for the passed block.  The work sum is updated accordingly when the node is
inserted into a chain.
package blockchain
import (
	"container/list"
	"fmt"
	"github.com/bitgo/prova/btcec"
	"github.com/bitgo/prova/chaincfg"
	"github.com/bitgo/prova/chaincfg/chainhash"
	"github.com/bitgo/prova/database"
	"github.com/bitgo/prova/provautil"
	"github.com/bitgo/prova/txscript"
	"github.com/bitgo/prova/wire"
	"math/big"
	"sort"
	"sync"
	"time"
)
const (
	maxOrphanBlocks = 1000
)
type blockNode struct {
	parent *blockNode
	children []*blockNode
	hash *chainhash.Hash
	parentHash *chainhash.Hash
	height uint32
	workSum *big.Int
	inMainChain bool
	version    uint32
	bits       uint32
	nonce      uint64
	timestamp  int64
	merkleRoot chainhash.Hash
	size       uint32
	signature  wire.BlockSignature
	validatingPubKey wire.BlockValidatingPubKey
}