storage: some minor storage & logging tweaks

This commit is contained in:
George Tankersley
2018-12-15 01:27:24 -05:00
parent a8e099d0fa
commit 8cb238fd60
3 changed files with 53 additions and 15 deletions

View File

@@ -205,14 +205,14 @@ func handleBlock(db *sql.DB, sequence int, blockData []byte) {
"block_hash": blockHash,
"block_version": block.GetVersion(),
"tx_count": block.GetTxCount(),
"has_sapling": block.HasSaplingTransactions(),
"sapling": block.HasSaplingTransactions(),
"error": err,
})
if err != nil {
entry.Error("error storing block")
entry.Error("new block")
} else {
entry.Info("received new block")
entry.Info("new block")
}
for index, tx := range block.Transactions() {
@@ -229,11 +229,12 @@ func handleBlock(db *sql.DB, sequence int, blockData []byte) {
"block_height": block.GetHeight(),
"block_hash": blockHash,
"tx_index": index,
"has_sapling": tx.HasSaplingTransactions(),
"tx_size": len(tx.Bytes()),
"sapling": tx.HasSaplingTransactions(),
"error": err,
})
if err != nil {
entry.Error("error storing tx")
entry.Error("storing tx")
} else {
entry.Debug("storing tx")
}