mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
limit max threshold nonce in queue
This commit is contained in:
parent
b360290ded
commit
2006e3240a
2 changed files with 16 additions and 12 deletions
|
|
@ -1,16 +1,17 @@
|
|||
package common
|
||||
|
||||
const (
|
||||
RewardMasterPercent = 40
|
||||
RewardVoterPercent = 50
|
||||
RewardFoundationPercent = 10
|
||||
HexSignMethod = "e341eaa4"
|
||||
HexSetSecret = "34d38600"
|
||||
HexSetOpening = "e11f5ba2"
|
||||
EpocBlockSecret = 800
|
||||
EpocBlockOpening = 850
|
||||
EpocBlockRandomize = 900
|
||||
MaxMasternodes = 150
|
||||
LimitPenaltyEpoch = 4
|
||||
BlocksPerYear = uint64(15768000)
|
||||
RewardMasterPercent = 40
|
||||
RewardVoterPercent = 50
|
||||
RewardFoundationPercent = 10
|
||||
HexSignMethod = "e341eaa4"
|
||||
HexSetSecret = "34d38600"
|
||||
HexSetOpening = "e11f5ba2"
|
||||
EpocBlockSecret = 800
|
||||
EpocBlockOpening = 850
|
||||
EpocBlockRandomize = 900
|
||||
MaxMasternodes = 150
|
||||
LimitPenaltyEpoch = 4
|
||||
BlocksPerYear = uint64(15768000)
|
||||
LimitThresholdNonceInQueue = 10
|
||||
)
|
||||
|
|
|
|||
|
|
@ -600,6 +600,9 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
|
|||
if pool.currentState.GetNonce(from) > tx.Nonce() {
|
||||
return ErrNonceTooLow
|
||||
}
|
||||
if pool.pendingState.GetNonce(from)+common.LimitThresholdNonceInQueue < tx.Nonce() {
|
||||
return ErrNonceTooHigh
|
||||
}
|
||||
// Transactor should have enough funds to cover the costs
|
||||
// cost == V + GP * GL
|
||||
if pool.currentState.GetBalance(from).Cmp(tx.Cost()) < 0 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue