Merged accounts and contracts in to StateObject
* Account removed * Contract removed * Address state changed to CachedStateObject * Added StateObject
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user