aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-06-04 17:35:37 +0800
committerobscuren <geffobscura@gmail.com>2015-06-04 17:35:37 +0800
commit36c0db2ac9e1505bfcb29a137f67ba31efde4c90 (patch)
tree0345050618c43e2401cfa0f9476f5fc45c6c752b
parent140d8839018527fe64a0c1a6b79af4ccae66ec3a (diff)
downloadgo-tangerine-36c0db2ac9e1505bfcb29a137f67ba31efde4c90.tar.gz
go-tangerine-36c0db2ac9e1505bfcb29a137f67ba31efde4c90.tar.zst
go-tangerine-36c0db2ac9e1505bfcb29a137f67ba31efde4c90.zip
xeth: use the correct nonce for creating transactions
-rw-r--r--xeth/xeth.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 187892a49..d0d51bfe0 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -942,18 +942,17 @@ func (self *XEth) Transact(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceS
if len(nonceStr) != 0 {
nonce = common.Big(nonceStr).Uint64()
} else {
- nonce = state.GetNonce(from) + 1 //state.NewNonce(from)
+ nonce = state.GetNonce(from)
}
tx.SetNonce(nonce)
if err := self.sign(tx, from, false); err != nil {
- //state.RemoveNonce(from, tx.Nonce())
return "", err
}
if err := self.backend.TxPool().Add(tx); err != nil {
- //state.RemoveNonce(from, tx.Nonce())
return "", err
}
+ state.SetNonce(from, nonce+1)
if contractCreation {
addr := core.AddressFromMessage(tx)