Add storing prevhash to local db and logs

This commit is contained in:
mdr0id
2019-07-09 15:52:35 -07:00
parent 03118ba2d7
commit 1002580cd9
3 changed files with 13 additions and 6 deletions

View File

@@ -202,13 +202,15 @@ func getBlock(rpcClient *rpcclient.Client, height int) (*parser.Block, error) {
func handleBlock(db *sql.DB, block *parser.Block) {
prevBlockHash := hex.EncodeToString(block.GetPrevHash())
blockHash := hex.EncodeToString(block.GetEncodableHash())
//blockHash := hex.EncodeToString(block.GetDisplayHash())
marshaledBlock, _ := proto.Marshal(block.ToCompact())
err := storage.StoreBlock(
db,
block.GetHeight(),
prevBlockHash,
blockHash,
block.HasSaplingTransactions(),
marshaledBlock,