From 38a690bfc20a25230d66713f40f3f0587ade785f Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Sun, 25 Nov 2018 11:16:29 -0800 Subject: [PATCH] add func for download and testing --- node/node.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/node/node.go b/node/node.go index fee218829..e26450151 100644 --- a/node/node.go +++ b/node/node.go @@ -80,6 +80,16 @@ type Node struct { testBankKey *ecdsa.PrivateKey } +// GetBlockHashes used for state download. +func (node *Node) GetBlockHashes() [][32]byte { + return node.blockchain.GetBlockHashes() +} + +// SetBlockchain is used for testing +func (node *Node) SetBlockchain(bc *blockchain.Blockchain) { + node.blockchain = bc +} + // Add new crossTx and proofs to the list of crossTx that needs to be sent back to client func (node *Node) addCrossTxsToReturn(crossTxs []*blockchain.CrossShardTxAndProof) { node.crossTxToReturnMutex.Lock()