aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.go
diff options
context:
space:
mode:
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r--xeth/xeth.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 692fb338c..ac59069d5 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -648,7 +648,7 @@ func (self *XEth) ConfirmTransaction(tx string) bool {
}
-func (self *XEth) Transact(fromStr, toStr, valueStr, gasStr, gasPriceStr, codeStr string) (string, error) {
+func (self *XEth) Transact(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceStr, codeStr string) (string, error) {
var (
from = common.HexToAddress(fromStr)
to = common.HexToAddress(toStr)
@@ -704,7 +704,13 @@ func (self *XEth) Transact(fromStr, toStr, valueStr, gasStr, gasPriceStr, codeSt
}
state := self.backend.ChainManager().TxState()
- nonce := state.NewNonce(from)
+
+ var nonce uint64
+ if len(nonceStr) != 0 {
+ nonce = common.Big(nonceStr).Uint64()
+ } else {
+ nonce = state.NewNonce(from)
+ }
tx.SetNonce(nonce)
if err := self.sign(tx, from, false); err != nil {