diff options
author | obscuren <geffobscura@gmail.com> | 2014-03-03 03:42:05 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-03-03 03:42:05 +0800 |
commit | d65b4cd0dd49975410374801fae3ece7d7e087b3 (patch) | |
tree | f8ce81fc3c9f376d65db151f4856118fdba13828 /ethchain/transaction_pool.go | |
parent | f1b354e6aa6c4b0330e35ae9011784ff1a0b01ab (diff) | |
download | go-tangerine-d65b4cd0dd49975410374801fae3ece7d7e087b3.tar.gz go-tangerine-d65b4cd0dd49975410374801fae3ece7d7e087b3.tar.zst go-tangerine-d65b4cd0dd49975410374801fae3ece7d7e087b3.zip |
Updated block to use state instead of trie directly
Diffstat (limited to 'ethchain/transaction_pool.go')
-rw-r--r-- | ethchain/transaction_pool.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ethchain/transaction_pool.go b/ethchain/transaction_pool.go index cd09bf02e..763560570 100644 --- a/ethchain/transaction_pool.go +++ b/ethchain/transaction_pool.go @@ -104,7 +104,7 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, block *Block) (err error } }() // Get the sender - sender := block.GetAddr(tx.Sender()) + sender := block.state.GetAccount(tx.Sender()) // Make sure there's enough in the sender's account. Having insufficient // funds won't invalidate this transaction but simple ignores it. @@ -122,7 +122,7 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, block *Block) (err error } // Get the receiver - receiver := block.GetAddr(tx.Recipient) + receiver := block.state.GetAccount(tx.Recipient) sender.Nonce += 1 // Send Tx to self @@ -136,10 +136,10 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, block *Block) (err error // Add the amount to receivers account which should conclude this transaction receiver.Amount.Add(receiver.Amount, tx.Value) - block.UpdateAddr(tx.Recipient, receiver) + block.state.UpdateAccount(tx.Recipient, receiver) } - block.UpdateAddr(tx.Sender(), sender) + block.state.UpdateAccount(tx.Sender(), sender) log.Printf("[TXPL] Processed Tx %x\n", tx.Hash()) |