Skip to content

Commit

Permalink
check if payment is in flight before sending.
Browse files Browse the repository at this point in the history
  • Loading branch information
fiatjaf committed Jul 3, 2022
1 parent ba4b502 commit 31b5ff1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/scala/Commands.scala
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ object Commands {
topic.publish1(JSONRPCError(id, "missing amount"))
case Some(prExt) if prExt.pr.paymentSecret == None =>
topic.publish1(JSONRPCError(id, "missing payment secret"))
case Some(prExt)
if LNParams.cm.checkIfSendable(
prExt.pr.paymentHash
) != PaymentInfo.Sendable =>
topic.publish1(JSONRPCError(id, "payment already sent or in flight"))
case Some(prExt) => {
val amount =
params.msatoshi
Expand Down

0 comments on commit 31b5ff1

Please sign in to comment.