Ver código fonte

core: better printout of receipts in bad block reports (#18156)

* core/blockchain: better printout of receipts in bad block reports

* fix splleing
Martin Holst Swende 7 anos atrás
pai
commit
e0d091e090
1 arquivos alterados com 4 adições e 2 exclusões
  1. 4 2
      core/blockchain.go

+ 4 - 2
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 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)
 	}
 	log.Error(fmt.Sprintf(`
 ########## BAD BLOCK #########