diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-15 20:05:15 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-15 20:05:15 +0800 |
commit | 7bf2ae0b116fff0fede5b1455c5fda20caf98252 (patch) | |
tree | 3a982f8fb8ee376ef2a55e8188923afc19442203 /ethchain | |
parent | 2734fc407959c0723889aabb20f0e0f1a49e490f (diff) | |
download | go-tangerine-7bf2ae0b116fff0fede5b1455c5fda20caf98252.tar go-tangerine-7bf2ae0b116fff0fede5b1455c5fda20caf98252.tar.gz go-tangerine-7bf2ae0b116fff0fede5b1455c5fda20caf98252.tar.bz2 go-tangerine-7bf2ae0b116fff0fede5b1455c5fda20caf98252.tar.lz go-tangerine-7bf2ae0b116fff0fede5b1455c5fda20caf98252.tar.xz go-tangerine-7bf2ae0b116fff0fede5b1455c5fda20caf98252.tar.zst go-tangerine-7bf2ae0b116fff0fede5b1455c5fda20caf98252.zip |
Removed old tx pool notification system. Fixes #19
Diffstat (limited to 'ethchain')
-rw-r--r-- | ethchain/block_chain.go | 3 | ||||
-rw-r--r-- | ethchain/transaction_pool.go | 19 |
2 files changed, 5 insertions, 17 deletions
diff --git a/ethchain/block_chain.go b/ethchain/block_chain.go index 2be4cd92b..11fbc7795 100644 --- a/ethchain/block_chain.go +++ b/ethchain/block_chain.go @@ -260,7 +260,7 @@ func AddTestNetFunds(block *Block) { "e6716f9544a56c530d868e4bfbacb172315bdead", // Jeffrey "1e12515ce3e0f817a4ddef9ca55788a1d66bd2df", // Vit "1a26338f0d905e295fccb71fa9ea849ffa12aaf4", // Alex - "2ef47100e0787b915105fd5e3f4ff6752079d5cb", // Maran + //"2ef47100e0787b915105fd5e3f4ff6752079d5cb", // Maran } { //log.Println("2^200 Wei to", addr) codedAddr := ethutil.FromHex(addr) @@ -268,6 +268,7 @@ func AddTestNetFunds(block *Block) { account.Amount = ethutil.BigPow(2, 200) block.state.UpdateStateObject(account) } + log.Printf("%x\n", block.RlpEncode()) } func (bc *BlockChain) setLastBlock() { diff --git a/ethchain/transaction_pool.go b/ethchain/transaction_pool.go index 6c0282dc6..21ce8cdc1 100644 --- a/ethchain/transaction_pool.go +++ b/ethchain/transaction_pool.go @@ -133,7 +133,8 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, block *Block, toContract log.Printf("[TXPL] Processed Tx %x\n", tx.Hash()) - pool.notifySubscribers(TxPost, tx) + // Notify all subscribers + pool.Ethereum.Reactor().Post("newTx:post", tx) return } @@ -188,10 +189,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 +250,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 - } -} |