Add storing prevhash to local db and logs
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user