Commit 8d5109e7 authored by Sebastian Stammler's avatar Sebastian Stammler

op-batcher: Rename TriggerTimeout -> CheckTimeout

parent 93f633d0
......@@ -136,9 +136,9 @@ func (c *channelBuilder) TimedOut(blockNum uint64) bool {
return c.timeout != 0 && blockNum >= c.timeout
}
// TriggerTimeout checks if the channel is timed out at the given timestamp and
// in this case sets the channel as full with reason ErrChannelTimedOut.
func (c *channelBuilder) TriggerTimeout(blockNum uint64) {
// CheckTimeout checks if the channel is timed out at the given block number and
// in this case marks the channel as full with reason ErrChannelTimedOut.
func (c *channelBuilder) CheckTimeout(blockNum uint64) {
if !c.IsFull() && c.TimedOut(blockNum) {
c.setFullErr(ErrChannelTimedOut)
}
......
......@@ -211,7 +211,7 @@ func (s *channelManager) TxData(l1Head eth.BlockID) ([]byte, txID, error) {
return nil, txID{}, err
}
s.triggerTimeout(l1Head)
s.checkTimeout(l1Head)
if err := s.processBlocks(); err != nil {
return nil, txID{}, err
......@@ -239,8 +239,9 @@ func (s *channelManager) ensurePendingChannel(l1Head eth.BlockID) error {
return nil
}
func (s *channelManager) triggerTimeout(l1Head eth.BlockID) {
s.pendingChannel.TriggerTimeout(l1Head.Number)
// checkTimeout checks the block timeout on the pending channel.
func (s *channelManager) checkTimeout(l1Head eth.BlockID) {
s.pendingChannel.CheckTimeout(l1Head.Number)
ferr := s.pendingChannel.FullErr()
s.log.Debug("timeout triggered",
"l1Head", l1Head,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment