mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-03-01 09:03:48 +00:00
xeth: use the correct nonce for creating transactions
This commit is contained in:
parent
140d883901
commit
36c0db2ac9
1 changed files with 2 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue