Commit a4f59e9e authored by Michael de Hoog's avatar Michael de Hoog

Don't return bool from TxFailed

parent d2569b3e
......@@ -41,7 +41,7 @@ func newPendingChannel(log log.Logger, metr metrics.Metricer, cfg ChannelConfig)
// TxFailed records a transaction as failed. It will attempt to resubmit the data
// in the failed transaction.
func (s *channel) TxFailed(id txID) bool {
func (s *channel) TxFailed(id txID) {
if data, ok := s.pendingTransactions[id]; ok {
s.log.Trace("marked transaction as failed", "id", id)
// Note: when the batcher is changed to send multiple frames per tx,
......@@ -54,8 +54,6 @@ func (s *channel) TxFailed(id txID) bool {
}
s.metr.RecordBatchTxFailed()
return len(s.pendingTransactions) == 0 && len(s.confirmedTransactions) == 0
}
// TxConfirmed marks a transaction as confirmed on L1. Unfortunately even if all frames in
......
......@@ -67,8 +67,8 @@ func (s *channelManager) Clear() {
func (s *channelManager) TxFailed(id txID) {
if channel, ok := s.txChannels[id]; ok {
delete(s.txChannels, id)
empty := channel.TxFailed(id)
if s.closed && empty {
channel.TxFailed(id)
if s.closed && channel.NoneSubmitted() {
s.log.Info("Channel has no submitted transactions, clearing for shutdown", "chID", channel.ID())
s.removePendingChannel(channel)
}
......
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