Commit 36c0db2a authored by obscuren's avatar obscuren

xeth: use the correct nonce for creating transactions

parent 140d8839
...@@ -942,18 +942,17 @@ func (self *XEth) Transact(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceS ...@@ -942,18 +942,17 @@ func (self *XEth) Transact(fromStr, toStr, nonceStr, valueStr, gasStr, gasPriceS
if len(nonceStr) != 0 { if len(nonceStr) != 0 {
nonce = common.Big(nonceStr).Uint64() nonce = common.Big(nonceStr).Uint64()
} else { } else {
nonce = state.GetNonce(from) + 1 //state.NewNonce(from) nonce = state.GetNonce(from)
} }
tx.SetNonce(nonce) tx.SetNonce(nonce)
if err := self.sign(tx, from, false); err != nil { if err := self.sign(tx, from, false); err != nil {
//state.RemoveNonce(from, tx.Nonce())
return "", err return "", err
} }
if err := self.backend.TxPool().Add(tx); err != nil { if err := self.backend.TxPool().Add(tx); err != nil {
//state.RemoveNonce(from, tx.Nonce())
return "", err return "", err
} }
state.SetNonce(from, nonce+1)
if contractCreation { if contractCreation {
addr := core.AddressFromMessage(tx) addr := core.AddressFromMessage(tx)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment