diff options
author | Wei-Ning Huang <w@cobinhood.com> | 2018-10-18 20:41:39 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-04-09 21:32:50 +0800 |
commit | 4d5e408a6634a08fcab122735c25d30d3170d932 (patch) | |
tree | 8a712a6c027c81d2f60c8f86a3d8cf4e84a19465 | |
parent | 13506b4e47662dcce303f8845a12048556a22aa3 (diff) | |
download | dexon-4d5e408a6634a08fcab122735c25d30d3170d932.tar.gz dexon-4d5e408a6634a08fcab122735c25d30d3170d932.tar.zst dexon-4d5e408a6634a08fcab122735c25d30d3170d932.zip |
app: fixup message format
-rw-r--r-- | core/blockchain.go | 6 | ||||
-rw-r--r-- | dex/app.go | 16 |
2 files changed, 11 insertions, 11 deletions
diff --git a/core/blockchain.go b/core/blockchain.go index 87e586d20..b66c0928f 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1554,7 +1554,7 @@ func (bc *BlockChain) insertPendingBlocks(chain types.Blocks) (int, []interface{ } receipts = append(receipts, receipt) allLogs = append(allLogs, receipt.Logs...) - log.Debug("apply transaction", "tx.hash", tx.Hash(), "nonce", tx.Nonce(), "amount", tx.Value()) + log.Debug("Apply transaction", "tx.hash", tx.Hash(), "nonce", tx.Nonce(), "amount", tx.Value()) } // Finalize the block, applying any consensus engine specific extras (e.g. block rewards) header.GasUsed = *usedGas @@ -1587,7 +1587,7 @@ func (bc *BlockChain) insertPendingBlocks(chain types.Blocks) (int, []interface{ for pendingHeight := bc.CurrentBlock().NumberU64() + 1; pendingHeight <= block.Header().WitnessHeight; pendingHeight++ { confirmedBlock, exist := bc.pendingBlocks[pendingHeight] if !exist { - log.Debug("block has already inserted", "height", pendingHeight) + log.Error("Block has already inserted", "height", pendingHeight) continue } @@ -1597,7 +1597,7 @@ func (bc *BlockChain) insertPendingBlocks(chain types.Blocks) (int, []interface{ } // Write the block to the chain and get the status. - log.Debug("insert pending block", "height", pendingHeight) + log.Debug("Insert pending block", "height", pendingHeight) status, err := bc.WriteBlockWithState(confirmedBlock.block, confirmedBlock.receipts, s) if err != nil { return i, events, coalescedLogs, fmt.Errorf("WriteBlockWithState error: %v", err) diff --git a/dex/app.go b/dex/app.go index 9b13c32b8..317711e94 100644 --- a/dex/app.go +++ b/dex/app.go @@ -141,10 +141,10 @@ func (d *DexconApp) PreparePayload(position coreTypes.Position) (payload []byte, for _, tx := range txs { if tx.Nonce() != stateDB.GetNonce(addr) { - log.Debug("break transaction", "tx.hash", tx.Hash(), "nonce", tx.Nonce(), "expect", stateDB.GetNonce(addr)) + log.Debug("Break transaction", "tx.hash", tx.Hash(), "nonce", tx.Nonce(), "expect", stateDB.GetNonce(addr)) break } - log.Debug("receive transaction", "tx.hash", tx.Hash(), "nonce", tx.Nonce(), "amount", tx.Value()) + log.Debug("Receive transaction", "tx.hash", tx.Hash(), "nonce", tx.Nonce(), "amount", tx.Value()) allTxs = append(allTxs, tx) } } @@ -200,25 +200,25 @@ func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, result coreTypes.F block := d.blockchain.GetConfirmedBlockByHash(blockHash) if block == nil { - log.Error("can not get confirmed block") + log.Error("Can not get confirmed block") return } var transactions types.Transactions err := rlp.Decode(bytes.NewReader(block.Payload), &transactions) if err != nil { - log.Error("payload rlp decode", "error", err) + log.Error("Payload rlp decode failed", "error", err) return } var witnessData witnessData err = rlp.Decode(bytes.NewReader(block.Witness.Data), &witnessData) if err != nil { - log.Error("witness rlp decode", "error", err) + log.Error("Witness rlp decode failed", "error", err) return } - log.Debug("block proposer id", "hash", block.ProposerID) + log.Debug("Block proposer id", "hash", block.ProposerID) newBlock := types.NewBlock(&types.Header{ Number: new(big.Int).SetUint64(result.Height), Time: big.NewInt(result.Timestamp.Unix()), @@ -233,11 +233,11 @@ func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, result coreTypes.F _, err = d.blockchain.InsertPendingBlock([]*types.Block{newBlock}) if err != nil { - log.Error("insert chain", "error", err) + log.Error("Insert chain", "error", err) return } - log.Debug("insert pending block success", "height", result.Height) + log.Debug("Insert pending block success", "height", result.Height) d.blockchain.RemoveConfirmedBlock(blockHash) d.notify(result.Height) |