aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-03-21 00:27:09 +0800
committerobscuren <geffobscura@gmail.com>2014-03-21 00:27:09 +0800
commit3520771d68df1e9becfb29cc2f85d7042f3fb9d1 (patch)
treea880e1ccdaee8e52b0ab33d09fe67d5d79ba8af2
parentc17381b853e2d762787ca30c5ce45aeece99dfd1 (diff)
downloaddexon-3520771d68df1e9becfb29cc2f85d7042f3fb9d1.tar
dexon-3520771d68df1e9becfb29cc2f85d7042f3fb9d1.tar.gz
dexon-3520771d68df1e9becfb29cc2f85d7042f3fb9d1.tar.bz2
dexon-3520771d68df1e9becfb29cc2f85d7042f3fb9d1.tar.lz
dexon-3520771d68df1e9becfb29cc2f85d7042f3fb9d1.tar.xz
dexon-3520771d68df1e9becfb29cc2f85d7042f3fb9d1.tar.zst
dexon-3520771d68df1e9becfb29cc2f85d7042f3fb9d1.zip
Comply to Callee interface
-rw-r--r--ethchain/transaction.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/ethchain/transaction.go b/ethchain/transaction.go
index 57df9cdc4..07e7ea970 100644
--- a/ethchain/transaction.go
+++ b/ethchain/transaction.go
@@ -29,6 +29,15 @@ func NewTransaction(to []byte, value *big.Int, data []string) *Transaction {
return &tx
}
+// Implements Callee
+func (tx *Transaction) ReturnGas(value *big.Int, state *State) {
+ // Return the value back to the sender
+ sender := tx.Sender()
+ account := state.GetAccount(sender)
+ account.AddFunds(value)
+ state.UpdateAccount(sender, account)
+}
+
// XXX Deprecated
func NewTransactionFromData(data []byte) *Transaction {
return NewTransactionFromBytes(data)