diff options
Diffstat (limited to 'ethchain/transaction_pool.go')
-rw-r--r-- | ethchain/transaction_pool.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ethchain/transaction_pool.go b/ethchain/transaction_pool.go index b0d62fd91..9a6322432 100644 --- a/ethchain/transaction_pool.go +++ b/ethchain/transaction_pool.go @@ -72,8 +72,6 @@ type TxPool struct { func NewTxPool(ethereum EthManager) *TxPool { return &TxPool{ - //server: s, - mutex: sync.Mutex{}, pool: list.New(), queueChan: make(chan *Transaction, txPoolQueueSize), quit: make(chan bool), @@ -101,7 +99,7 @@ func (pool *TxPool) ValidateTransaction(tx *Transaction) error { return fmt.Errorf("[TXPL] No last block on the block chain") } - if len(tx.Recipient) != 20 { + if len(tx.Recipient) != 0 && len(tx.Recipient) != 20 { return fmt.Errorf("[TXPL] Invalid recipient. len = %d", len(tx.Recipient)) } @@ -150,7 +148,10 @@ out: // Call blocking version. pool.addTransaction(tx) - txplogger.Debugf("(t) %x => %x (%v) %x\n", tx.Sender()[:4], tx.Recipient[:4], tx.Value, tx.Hash()) + tmp := make([]byte, 4) + copy(tmp, tx.Recipient) + + txplogger.Debugf("(t) %x => %x (%v) %x\n", tx.Sender()[:4], tmp, tx.Value, tx.Hash()) // Notify the subscribers pool.Ethereum.Reactor().Post("newTx:pre", tx) |