Skip to content

Commit

Permalink
Cleanup register and prevent multiple swaps per channel
Browse files Browse the repository at this point in the history
  • Loading branch information
remyers committed Oct 26, 2022
1 parent 4da5074 commit ddef11d
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ import fr.acinq.eclair.plugins.peerswap.SwapResponses.Status

object StatusAggregator {
def apply(swapsCount: Int, replyTo: ActorRef[Iterable[Status]]): Behavior[Status] = Behaviors.setup { context =>
new StatusAggregator(context, swapsCount, replyTo).waiting(Set())
if (swapsCount == 0) {
replyTo ! Seq()
Behaviors.stopped
} else {
new StatusAggregator(context, swapsCount, replyTo).waiting(Set())
}
}
}

Expand Down

0 comments on commit ddef11d

Please sign in to comment.