mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
Fixed duplicate nonce value for randomize and sign txs
This commit is contained in:
parent
9a8be4e031
commit
4c2c909f0f
1 changed files with 5 additions and 4 deletions
|
|
@ -95,9 +95,7 @@ func CreateTransactionSign(chainConfig *params.ChainConfig, pool *core.TxPool, m
|
||||||
// Only process when private key empty in state db.
|
// Only process when private key empty in state db.
|
||||||
// Save randomize key into state db.
|
// Save randomize key into state db.
|
||||||
randomizeKeyValue := RandStringByte(32)
|
randomizeKeyValue := RandStringByte(32)
|
||||||
chainDb.Put(randomizeKeyName, randomizeKeyValue)
|
tx, err := BuildTxSecretRandomize(nonce+1, common.HexToAddress(common.RandomizeSMC), chainConfig.Posv.Epoch, randomizeKeyValue)
|
||||||
|
|
||||||
tx, err := BuildTxSecretRandomize(nonce, common.HexToAddress(common.RandomizeSMC), chainConfig.Posv.Epoch, randomizeKeyValue)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Fail to get tx opening for randomize", "error", err)
|
log.Error("Fail to get tx opening for randomize", "error", err)
|
||||||
return err
|
return err
|
||||||
|
|
@ -112,6 +110,9 @@ func CreateTransactionSign(chainConfig *params.ChainConfig, pool *core.TxPool, m
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Fail to add tx secret to local pool.", "error", err)
|
log.Error("Fail to add tx secret to local pool.", "error", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Put randomize key into chainDb.
|
||||||
|
chainDb.Put(randomizeKeyName, randomizeKeyValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set opening for randomize.
|
// Set opening for randomize.
|
||||||
|
|
@ -121,7 +122,7 @@ func CreateTransactionSign(chainConfig *params.ChainConfig, pool *core.TxPool, m
|
||||||
log.Error("Fail to get randomize key from state db.", "error", err)
|
log.Error("Fail to get randomize key from state db.", "error", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
tx, err := BuildTxOpeningRandomize(nonce, common.HexToAddress(common.RandomizeSMC), randomizeKeyValue)
|
tx, err := BuildTxOpeningRandomize(nonce+1, common.HexToAddress(common.RandomizeSMC), randomizeKeyValue)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Fail to get tx opening for randomize", "error", err)
|
log.Error("Fail to get tx opening for randomize", "error", err)
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue