diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-16 10:06:51 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-16 10:06:51 +0800 |
commit | 9c6aca78933c14ca107da30c4690808950718368 (patch) | |
tree | da641b2904ea6ed05870a1ded486543529eae5a3 /ethchain/block.go | |
parent | ca13e3b1058f0d680b79dc1d9319d427a09493f8 (diff) | |
download | dexon-9c6aca78933c14ca107da30c4690808950718368.tar dexon-9c6aca78933c14ca107da30c4690808950718368.tar.gz dexon-9c6aca78933c14ca107da30c4690808950718368.tar.bz2 dexon-9c6aca78933c14ca107da30c4690808950718368.tar.lz dexon-9c6aca78933c14ca107da30c4690808950718368.tar.xz dexon-9c6aca78933c14ca107da30c4690808950718368.tar.zst dexon-9c6aca78933c14ca107da30c4690808950718368.zip |
Merged accounts and contracts in to StateObject
* Account removed
* Contract removed
* Address state changed to CachedStateObject
* Added StateObject
Diffstat (limited to 'ethchain/block.go')
-rw-r--r-- | ethchain/block.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ethchain/block.go b/ethchain/block.go index 732739c1b..8c93947fb 100644 --- a/ethchain/block.go +++ b/ethchain/block.go @@ -142,12 +142,13 @@ func (block *Block) PayFee(addr []byte, fee *big.Int) bool { data := block.state.trie.Get(string(block.Coinbase)) // Get the ether (Coinbase) and add the fee (gief fee to miner) - ether := NewAccountFromData(block.Coinbase, []byte(data)) + account := NewStateObjectFromBytes(block.Coinbase, []byte(data)) base = new(big.Int) - ether.Amount = base.Add(ether.Amount, fee) + account.Amount = base.Add(account.Amount, fee) - block.state.trie.Update(string(block.Coinbase), string(ether.RlpEncode())) + //block.state.trie.Update(string(block.Coinbase), string(ether.RlpEncode())) + block.state.UpdateStateObject(account) return true } |