Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
libotony committed Sep 19, 2024
1 parent 3711d60 commit 5288d92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions txpool/tx_object.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() + 1):
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
Expand All @@ -81,7 +81,7 @@ func (o *txObject) Executable(chain *chain.Chain, state *state.State, headBlock
}
}

// tx valid in the future
// 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
}
Expand Down

0 comments on commit 5288d92

Please sign in to comment.