Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ class MultiPartHandler(nodeParams: NodeParams, register: ActorRef, db: IncomingP
Some(PaymentRequest.PaymentRequestFeatures(f1 ++ f2 ++ f3: _*))
}
val (paymentPreimage, paymentRequest) = if (allowPTLC) {
val paymentScalar = randomKey
val paymentPreimage = paymentPreimage_opt.getOrElse(randomKey.value)
val paymentScalar = PrivateKey(paymentPreimage)
val paymentPoint = paymentScalar.publicKey
val paymentPreimage = paymentScalar.value
(paymentPreimage, PaymentRequest(nodeParams.chainHash, amount_opt, paymentPoint, nodeParams.privateKey, desc, nodeParams.minFinalExpiryDelta, fallbackAddress_opt, expirySeconds = Some(expirySeconds), extraHops = extraHops, features = features))
} else {
val paymentPreimage = paymentPreimage_opt.getOrElse(randomBytes32)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class PaymentLifecycle(nodeParams: NodeParams, cfg: SendPaymentConfig, router: A
case Event(RES_ADD_SETTLED(_, ptlc: UpdateAddPtlc, fulfill: HtlcResult.FulfillPtlc), d: WaitingForComplete) =>
Metrics.PaymentAttempt.withTag(Tags.MultiPart, value = false).record(d.failures.size + 1)
val p = PartialPayment(id, d.c.finalPayload.amount, d.cmd.amount - d.c.finalPayload.amount, ptlc.channelId, Some(cfg.fullRoute(d.route)))
log.info(s"Add settled PTLC with preimage=${fulfill.paymentPreimage.value}.")
onSuccess(d.c.replyTo, cfg.createPaymentSent(fulfill.paymentPreimage.value, p :: Nil))
myStop()

Expand Down