aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-21 18:38:56 +0800
committerobscuren <geffobscura@gmail.com>2014-05-21 18:38:56 +0800
commit0c27c5eb7fd4cea3ccdf26096a47ed91b0e9b848 (patch)
treebbcf90bece671cc1fe6626887a8b38e9dffd433c /ethchain
parent05e4e9727675f84c5768636070b6a79beea050aa (diff)
downloaddexon-0c27c5eb7fd4cea3ccdf26096a47ed91b0e9b848.tar.gz
dexon-0c27c5eb7fd4cea3ccdf26096a47ed91b0e9b848.tar.zst
dexon-0c27c5eb7fd4cea3ccdf26096a47ed91b0e9b848.zip
Proper log statement
Diffstat (limited to 'ethchain')
-rw-r--r--ethchain/transaction_pool.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/ethchain/transaction_pool.go b/ethchain/transaction_pool.go
index 796ec7c9a..dcf0c4c31 100644
--- a/ethchain/transaction_pool.go
+++ b/ethchain/transaction_pool.go
@@ -81,8 +81,9 @@ func NewTxPool(ethereum EthManager) *TxPool {
// Blocking function. Don't use directly. Use QueueTransaction instead
func (pool *TxPool) addTransaction(tx *Transaction) {
pool.mutex.Lock()
+ defer pool.mutex.Unlock()
+
pool.pool.PushBack(tx)
- pool.mutex.Unlock()
// Broadcast the transaction to the rest of the peers
pool.Ethereum.Broadcast(ethwire.MsgTxTy, []interface{}{tx.RlpData()})
@@ -182,9 +183,7 @@ out:
// Validate the transaction
err := pool.ValidateTransaction(tx)
if err != nil {
- if ethutil.Config.Debug {
- log.Println("Validating Tx failed", err)
- }
+ ethutil.Config.Log.Debugln("Validating Tx failed", err)
} else {
// Call blocking version.
pool.addTransaction(tx)