Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add singleton actor AsyncPaymentTriggerer to monitor when the receiver of an async payment reconnects #2491

Merged
merged 9 commits into from
Jan 2, 2023
Prev Previous commit
Next Next commit
Fixed nits from t-bast
remyers committed Dec 22, 2022
commit ff18504f350b0a8fbffd50feef15228caa87a77d
Original file line number Diff line number Diff line change
@@ -117,8 +117,9 @@ private class AsyncPaymentTriggerer(switchboard: ActorRef[Switchboard.GetPeerInf
case NotifierStopped(remoteNodeId) =>
peers.get(remoteNodeId) match {
case None => Behaviors.same
case Some(peer) => peer.timeout()
case Some(peer) =>
context.log.error(s"PeerReadyNotifier stopped unexpectedly while watching node $remoteNodeId.")
peer.timeout()
watching(peers - remoteNodeId)
}
}
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ object NodeRelay {
context.messageAdapter[MultiPartPaymentFSM.MultiPartPaymentFailed](WrappedMultiPartPaymentFailed)
context.messageAdapter[MultiPartPaymentFSM.MultiPartPaymentSucceeded](WrappedMultiPartPaymentSucceeded)
}.toClassic
val incomingPaymentHandler: ActorRef = context.actorOf(MultiPartPaymentFSM.props(nodeParams, paymentHash, totalAmountIn, mppFsmAdapters))
val incomingPaymentHandler = context.actorOf(MultiPartPaymentFSM.props(nodeParams, paymentHash, totalAmountIn, mppFsmAdapters))
new NodeRelay(nodeParams, parent, register, relayId, paymentHash, nodeRelayPacket.outerPayload.paymentSecret, context, outgoingPaymentFactory, triggerer)
.receiving(Queue.empty, nodeRelayPacket.innerPayload, nodeRelayPacket.nextPacket, incomingPaymentHandler)
}