diff options
author | Bojie Wu <bojie@dexon.org> | 2018-10-09 13:28:45 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@dexon.org> | 2019-03-12 12:19:09 +0800 |
commit | d148798b404ed7089703f62fe983f4a79402aa6b (patch) | |
tree | e54ea7a466c4b66dc78acb3d5f1b1545d771b895 /dex | |
parent | d7e1207ad870969dfa9612e882bc64ec30a7f71f (diff) | |
download | dexon-d148798b404ed7089703f62fe983f4a79402aa6b.tar dexon-d148798b404ed7089703f62fe983f4a79402aa6b.tar.gz dexon-d148798b404ed7089703f62fe983f4a79402aa6b.tar.bz2 dexon-d148798b404ed7089703f62fe983f4a79402aa6b.tar.lz dexon-d148798b404ed7089703f62fe983f4a79402aa6b.tar.xz dexon-d148798b404ed7089703f62fe983f4a79402aa6b.tar.zst dexon-d148798b404ed7089703f62fe983f4a79402aa6b.zip |
app: fix log message
Diffstat (limited to 'dex')
-rw-r--r-- | dex/app.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/dex/app.go b/dex/app.go index 78e8a0260..35a771460 100644 --- a/dex/app.go +++ b/dex/app.go @@ -142,7 +142,7 @@ func (d *DexconApp) PreparePayload(position coreTypes.Position) (payload []byte, gp := new(core.GasPool).AddGas(math.MaxUint64) _, _, err = core.ApplyTransaction(d.blockchain.Config(), d.blockchain, nil, gp, stateDB, currentBlock.Header(), tx, &gasUsed, d.vmConfig) if err != nil { - log.Error("apply confirmed transaction error: %v", err) + log.Error("apply confirmed transaction", "error", err) return nil, err } } @@ -151,7 +151,7 @@ func (d *DexconApp) PreparePayload(position coreTypes.Position) (payload []byte, // apply transaction to calculate total gas used, validate nonce and check available balance _, _, err = core.ApplyTransaction(d.blockchain.Config(), d.blockchain, nil, gp, stateDB, currentBlock.Header(), tx, &totalGasUsed, d.vmConfig) if err != nil || totalGasUsed > gasLimit { - log.Debug("apply transaction fail error: %v, totalGasUsed: %d, gasLimit: %d", err, totalGasUsed, gasLimit) + log.Debug("apply transaction fail", "error", err, "totalGasUsed", totalGasUsed, "gasLimit", gasLimit) break } allTxs = append(allTxs, tx) @@ -224,7 +224,7 @@ func (d *DexconApp) VerifyBlock(block *coreTypes.Block) bool { } if !d.checkChain(msg.From(), chainSize, chainID) { - log.Error("%s can not be delivered on chain %d", msg.From().String(), chainID) + log.Error("check chain fail", "from", msg.From().String(), "chainSize", chainSize, "chainID", chainID) return false } @@ -232,7 +232,7 @@ func (d *DexconApp) VerifyBlock(block *coreTypes.Block) bool { if !exist { txs, err := d.blockchain.GetConfirmedTxsByAddress(block.Position.ChainID, msg.From()) if err != nil { - log.Error("get confirmed txs by address error: %v", err) + log.Error("get confirmed txs by address", "error", err) return false } @@ -242,7 +242,7 @@ func (d *DexconApp) VerifyBlock(block *coreTypes.Block) bool { // confirmed txs must apply successfully _, _, err := core.ApplyTransaction(d.blockchain.Config(), d.blockchain, nil, gp, stateDB, currentBlock.Header(), tx, &gasUsed, d.vmConfig) if err != nil { - log.Error("apply confirmed transaction error: %v", err) + log.Error("apply confirmed transaction", "error", err) return false } } @@ -251,7 +251,7 @@ func (d *DexconApp) VerifyBlock(block *coreTypes.Block) bool { _, _, err = core.ApplyTransaction(d.blockchain.Config(), d.blockchain, nil, gp, stateDB, currentBlock.Header(), transaction, &totalGasUsed, d.vmConfig) if err != nil { - log.Error("apply block transaction error: %v", err) + log.Error("apply block transaction", "error", err) return false } } @@ -302,7 +302,7 @@ func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, result coreTypes.F var transactions types.Transactions err := rlp.Decode(bytes.NewReader(block.Payload), &transactions) if err != nil { - log.Error("payload rlp decode error: %v", err) + log.Error("payload rlp decode", "error", err) return } @@ -315,7 +315,7 @@ func (d *DexconApp) BlockDelivered(blockHash coreCommon.Hash, result coreTypes.F Coinbase: common.BytesToAddress(block.ProposerID.Hash[:]), }, transactions, nil, nil)}) if err != nil { - log.Error("insert chain error: %v", err) + log.Error("insert chain", "error", err) return } |