From 143985d345a2851aeeb864ec2a74bb8a75a6dc4e Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 21 Nov 2018 14:15:03 +0100 Subject: [PATCH 1/2] core/blockchain: better printout of receipts in bad block reports --- core/blockchain.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index d173b2de294d..0f4e5d977e28 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1469,8 +1469,10 @@ func (bc *BlockChain) reportBlock(block *types.Block, receipts types.Receipts, e bc.addBadBlock(block) var receiptString string - for _, receipt := range receipts { - receiptString += fmt.Sprintf("\t%v\n", receipt) + for i, receipt := range receipts { + receiptString += fmt.Sprintf("\t %d: cumulative: %v gas: %v contrract: %v status: %v tx: %v logs: %v bloom: %x state: %x\n", + i, receipt.CumulativeGasUsed, receipt.GasUsed, receipt.ContractAddress.Hex(), + receipt.Status, receipt.TxHash.Hex(), receipt.Logs, receipt.Bloom, receipt.PostState) } log.Error(fmt.Sprintf(` ########## BAD BLOCK ######### From f7759b40bed1ae8b5bf284c2a55d434b59576b88 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 21 Nov 2018 22:14:37 +0100 Subject: [PATCH 2/2] fix splleing --- core/blockchain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/blockchain.go b/core/blockchain.go index 0f4e5d977e28..4de7f007b5be 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1470,7 +1470,7 @@ func (bc *BlockChain) reportBlock(block *types.Block, receipts types.Receipts, e var receiptString string for i, receipt := range receipts { - receiptString += fmt.Sprintf("\t %d: cumulative: %v gas: %v contrract: %v status: %v tx: %v logs: %v bloom: %x state: %x\n", + receiptString += fmt.Sprintf("\t %d: cumulative: %v gas: %v contract: %v status: %v tx: %v logs: %v bloom: %x state: %x\n", i, receipt.CumulativeGasUsed, receipt.GasUsed, receipt.ContractAddress.Hex(), receipt.Status, receipt.TxHash.Hex(), receipt.Logs, receipt.Bloom, receipt.PostState) }