diff --git a/txpool/tx_object.go b/txpool/tx_object.go index dd511cad7..95f690625 100644 --- a/txpool/tx_object.go +++ b/txpool/tx_object.go @@ -55,7 +55,7 @@ func (o *txObject) Executable(chain *chain.Chain, state *state.State, headBlock switch { case o.Gas() > headBlock.GasLimit(): return false, errors.New("gas too large") - case o.IsExpired(headBlock.Number()): + case o.IsExpired(headBlock.Number() + 1): // Check tx expiration on top of next block return false, errors.New("expired") case o.BlockRef().Number() > headBlock.Number()+uint32(5*60/thor.BlockInterval): // reject deferred tx which will be applied after 5mins @@ -81,13 +81,11 @@ func (o *txObject) Executable(chain *chain.Chain, state *state.State, headBlock } } - if o.BlockRef().Number() > headBlock.Number() { + // Tx is considered executable when the BlockRef has passed in reference to the next block. + if o.BlockRef().Number() > headBlock.Number()+1 { return false, nil } - // checkpoint := state.NewCheckpoint() - // defer state.RevertTo(checkpoint) - if _, _, _, _, err := o.resolved.BuyGas(state, headBlock.Timestamp()+thor.BlockInterval); err != nil { return false, err }