aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/transaction_pool.go
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-03-10 18:53:02 +0800
committerMaran <maran.hidskes@gmail.com>2014-03-10 18:53:02 +0800
commitd5efeab8f92509dec3cafcafb36e1856bb084f12 (patch)
tree1d455afb8824391da15b2f537f17f87fb1678998 /ethchain/transaction_pool.go
parentbe543a6d178063a60d404a373ced296ed6d4744c (diff)
downloaddexon-d5efeab8f92509dec3cafcafb36e1856bb084f12.tar.gz
dexon-d5efeab8f92509dec3cafcafb36e1856bb084f12.tar.zst
dexon-d5efeab8f92509dec3cafcafb36e1856bb084f12.zip
Initial smart-miner stuff
Diffstat (limited to 'ethchain/transaction_pool.go')
-rw-r--r--ethchain/transaction_pool.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/ethchain/transaction_pool.go b/ethchain/transaction_pool.go
index 2c9a26936..345764d09 100644
--- a/ethchain/transaction_pool.go
+++ b/ethchain/transaction_pool.go
@@ -91,6 +91,7 @@ func (pool *TxPool) addTransaction(tx *Transaction) {
// Process transaction validates the Tx and processes funds from the
// sender to the recipient.
func (pool *TxPool) ProcessTransaction(tx *Transaction, block *Block) (err error) {
+ log.Println("Processing TX")
defer func() {
if r := recover(); r != nil {
log.Println(r)
@@ -137,7 +138,6 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, block *Block) (err error
log.Printf("[TXPL] Processed Tx %x\n", tx.Hash())
- // Notify the subscribers
pool.notifySubscribers(TxPost, tx)
return
@@ -174,6 +174,7 @@ out:
for {
select {
case tx := <-pool.queueChan:
+ log.Println("Received new Tx to queue")
hash := tx.Hash()
foundTx := FindTx(pool.pool, func(tx *Transaction, e *list.Element) bool {
return bytes.Compare(tx.Hash(), hash) == 0
@@ -190,9 +191,14 @@ out:
log.Println("Validating Tx failed", err)
}
} else {
+ log.Println("Transaction ok, adding")
// Call blocking version. At this point it
// doesn't matter since this is a goroutine
pool.addTransaction(tx)
+ log.Println("Added")
+
+ // Notify the subscribers
+ pool.Ethereum.Reactor().Post("newTx", tx)
// Notify the subscribers
pool.notifySubscribers(TxPre, tx)