aboutsummaryrefslogtreecommitdiffstats
path: root/rpc/api/eth.go
diff options
context:
space:
mode:
authorBas van Kervel <bas@ethdev.com>2015-06-24 20:56:53 +0800
committerBas van Kervel <bas@ethdev.com>2015-06-30 17:20:31 +0800
commitec866b066ace5d80c3c6a69349dbb1fac4503b46 (patch)
treec87dd0dc6ab981f4e1bdb6c734a7e39293d47e6d /rpc/api/eth.go
parent056e9dd393eeb7ddb4f6bf3e508228e1874bc94e (diff)
downloadgo-tangerine-ec866b066ace5d80c3c6a69349dbb1fac4503b46.tar.gz
go-tangerine-ec866b066ace5d80c3c6a69349dbb1fac4503b46.tar.zst
go-tangerine-ec866b066ace5d80c3c6a69349dbb1fac4503b46.zip
added eth.resend
Diffstat (limited to 'rpc/api/eth.go')
-rw-r--r--rpc/api/eth.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/rpc/api/eth.go b/rpc/api/eth.go
index d77bf9803..1883e363c 100644
--- a/rpc/api/eth.go
+++ b/rpc/api/eth.go
@@ -6,6 +6,7 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/common"
+ "github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/rpc/codec"
"github.com/ethereum/go-ethereum/rpc/shared"
@@ -74,6 +75,7 @@ var (
"eth_hashrate": (*ethApi).Hashrate,
"eth_getWork": (*ethApi).GetWork,
"eth_submitWork": (*ethApi).SubmitWork,
+ "eth_resend": (*ethApi).Resend,
"eth_pendingTransactions": (*ethApi).PendingTransactions,
}
)
@@ -553,6 +555,22 @@ func (self *ethApi) SubmitWork(req *shared.Request) (interface{}, error) {
return self.xeth.RemoteMining().SubmitWork(args.Nonce, common.HexToHash(args.Digest), common.HexToHash(args.Header)), nil
}
+func (self *ethApi) Resend(req *shared.Request) (interface{}, error) {
+ args := new(ResendArgs)
+ if err := self.codec.Decode(req.Params, &args); err != nil {
+ return nil, shared.NewDecodeParamError(err.Error())
+ }
+
+ ret, err := self.xeth.Transact(args.Tx.From, args.Tx.To, args.Tx.Nonce, args.Tx.Value, args.GasLimit, args.GasPrice, args.Tx.Data)
+ if err != nil {
+ return nil, err
+ }
+
+ self.ethereum.TxPool().RemoveTransactions(types.Transactions{args.Tx.tx})
+
+ return ret, nil
+}
+
func (self *ethApi) PendingTransactions(req *shared.Request) (interface{}, error) {
txs := self.ethereum.TxPool().GetTransactions()