|
|
@ -81,8 +81,9 @@ func NewTxPool(ethereum EthManager) *TxPool { |
|
|
|
// Blocking function. Don't use directly. Use QueueTransaction instead
|
|
|
|
// Blocking function. Don't use directly. Use QueueTransaction instead
|
|
|
|
func (pool *TxPool) addTransaction(tx *Transaction) { |
|
|
|
func (pool *TxPool) addTransaction(tx *Transaction) { |
|
|
|
pool.mutex.Lock() |
|
|
|
pool.mutex.Lock() |
|
|
|
|
|
|
|
defer pool.mutex.Unlock() |
|
|
|
|
|
|
|
|
|
|
|
pool.pool.PushBack(tx) |
|
|
|
pool.pool.PushBack(tx) |
|
|
|
pool.mutex.Unlock() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Broadcast the transaction to the rest of the peers
|
|
|
|
// Broadcast the transaction to the rest of the peers
|
|
|
|
pool.Ethereum.Broadcast(ethwire.MsgTxTy, []interface{}{tx.RlpData()}) |
|
|
|
pool.Ethereum.Broadcast(ethwire.MsgTxTy, []interface{}{tx.RlpData()}) |
|
|
@ -182,9 +183,7 @@ out: |
|
|
|
// Validate the transaction
|
|
|
|
// Validate the transaction
|
|
|
|
err := pool.ValidateTransaction(tx) |
|
|
|
err := pool.ValidateTransaction(tx) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
if ethutil.Config.Debug { |
|
|
|
ethutil.Config.Log.Debugln("Validating Tx failed", err) |
|
|
|
log.Println("Validating Tx failed", err) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// Call blocking version.
|
|
|
|
// Call blocking version.
|
|
|
|
pool.addTransaction(tx) |
|
|
|
pool.addTransaction(tx) |
|
|
|