aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/transaction_pool.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-20 23:09:44 +0800
committerobscuren <geffobscura@gmail.com>2014-05-20 23:09:44 +0800
commit4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0 (patch)
treed4622ae52bcc4c158aa26cf171a306979307bfc9 /ethchain/transaction_pool.go
parent6efdd21633c1d21f36080754a89ad82c0c244128 (diff)
parentc37b3cef7dc465832761b1da6761eeaa47e368d1 (diff)
downloaddexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar
dexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.gz
dexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.bz2
dexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.lz
dexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.xz
dexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.tar.zst
dexon-4b13f93a3e0f2901a8e1aa38dfef115e24c63ef0.zip
Merge branch 'release/poc5-rc7'
Diffstat (limited to 'ethchain/transaction_pool.go')
-rw-r--r--ethchain/transaction_pool.go24
1 files changed, 6 insertions, 18 deletions
diff --git a/ethchain/transaction_pool.go b/ethchain/transaction_pool.go
index 6c0282dc6..796ec7c9a 100644
--- a/ethchain/transaction_pool.go
+++ b/ethchain/transaction_pool.go
@@ -131,9 +131,10 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, block *Block, toContract
block.state.UpdateStateObject(sender)
- log.Printf("[TXPL] Processed Tx %x\n", tx.Hash())
+ ethutil.Config.Log.Infof("[TXPL] Processed Tx %x\n", tx.Hash())
- pool.notifySubscribers(TxPost, tx)
+ // Notify all subscribers
+ pool.Ethereum.Reactor().Post("newTx:post", tx)
return
}
@@ -148,7 +149,8 @@ func (pool *TxPool) ValidateTransaction(tx *Transaction) error {
}
// Get the sender
- sender := pool.Ethereum.StateManager().procState.GetAccount(tx.Sender())
+ //sender := pool.Ethereum.StateManager().procState.GetAccount(tx.Sender())
+ sender := pool.Ethereum.StateManager().CurrentState().GetAccount(tx.Sender())
totAmount := new(big.Int).Add(tx.Value, new(big.Int).Mul(TxFee, TxFeeRat))
// Make sure there's enough in the sender's account. Having insufficient
@@ -188,10 +190,7 @@ out:
pool.addTransaction(tx)
// Notify the subscribers
- pool.Ethereum.Reactor().Post("newTx", tx)
-
- // Notify the subscribers
- pool.notifySubscribers(TxPre, tx)
+ pool.Ethereum.Reactor().Post("newTx:pre", tx)
}
case <-pool.quit:
break out
@@ -252,14 +251,3 @@ func (pool *TxPool) Stop() {
log.Println("[TXP] Stopped")
}
-
-func (pool *TxPool) Subscribe(channel chan TxMsg) {
- pool.subscribers = append(pool.subscribers, channel)
-}
-
-func (pool *TxPool) notifySubscribers(ty TxMsgTy, tx *Transaction) {
- msg := TxMsg{Type: ty, Tx: tx}
- for _, subscriber := range pool.subscribers {
- subscriber <- msg
- }
-}