diff options
author | obscuren <geffobscura@gmail.com> | 2014-07-30 06:31:15 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-07-30 06:31:15 +0800 |
commit | 1f9894c0845a5259adbfd30fe3a86631e6403b8d (patch) | |
tree | 7e038ca62c65482d576d3a8b3fde5419ac866f2f /ethchain/block.go | |
parent | 27f892265312255811867fab83acbeefa1626cec (diff) | |
download | dexon-1f9894c0845a5259adbfd30fe3a86631e6403b8d.tar.gz dexon-1f9894c0845a5259adbfd30fe3a86631e6403b8d.tar.zst dexon-1f9894c0845a5259adbfd30fe3a86631e6403b8d.zip |
Old code removed and renamed amount to balance
Diffstat (limited to 'ethchain/block.go')
-rw-r--r-- | ethchain/block.go | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/ethchain/block.go b/ethchain/block.go index e00bcb24f..ac56f58c3 100644 --- a/ethchain/block.go +++ b/ethchain/block.go @@ -125,33 +125,6 @@ func (block *Block) Transactions() []*Transaction { return block.transactions } -func (block *Block) PayFee(addr []byte, fee *big.Int) bool { - contract := block.state.GetStateObject(addr) - // If we can't pay the fee return - if contract == nil || contract.Amount.Cmp(fee) < 0 /* amount < fee */ { - fmt.Println("Contract has insufficient funds", contract.Amount, fee) - - return false - } - - base := new(big.Int) - contract.Amount = base.Sub(contract.Amount, fee) - block.state.Trie.Update(string(addr), string(contract.RlpEncode())) - - data := block.state.Trie.Get(string(block.Coinbase)) - - // Get the ether (Coinbase) and add the fee (gief fee to miner) - account := ethstate.NewStateObjectFromBytes(block.Coinbase, []byte(data)) - - base = new(big.Int) - account.Amount = base.Add(account.Amount, fee) - - //block.state.Trie.Update(string(block.Coinbase), string(ether.RlpEncode())) - block.state.UpdateStateObject(account) - - return true -} - func (block *Block) CalcGasLimit(parent *Block) *big.Int { if block.Number.Cmp(big.NewInt(0)) == 0 { return ethutil.BigPow(10, 6) |