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 log when sending BOLT 12 invoice #684

Merged
merged 2 commits into from
Jul 10, 2024
Merged
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 @@ -183,7 +183,10 @@ class OfferManager(val nodeParams: NodeParams, val walletParams: WalletParams, v
logger.warning { "offerId:${offer.offerId} pathId:${decrypted.pathId} ignoring invoice request, could not build onion message: ${invoiceMessage.value}" }
sendInvoiceError("failed to build onion message", decrypted.content.replyPath)
}
is Right -> OnionMessageAction.SendMessage(invoiceMessage.value)
is Right -> {
logger.info { "sending BOLT 12 invoice with amount=${invoice.amount}, paymentHash=${invoice.paymentHash}, payerId=${invoice.invoiceRequest.payerId} to introduction node ${destination.route.introductionNodeId}" }
OnionMessageAction.SendMessage(invoiceMessage.value)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,9 @@ data class OnionMessage(
OnionRoutingPacketSerializer(onionRoutingPacket.payload.size()).write(onionRoutingPacket, out)
}

override fun toString(): String =
"OnionMessage(blindingKey=$blindingKey, onionRoutingPacket=OnionRoutingPacket(version=${onionRoutingPacket.version}, publicKey=${onionRoutingPacket.publicKey.toHex()}, payload=<${onionRoutingPacket.payload.size()} bytes>, hmac=${onionRoutingPacket.hmac.toHex()}))"

companion object : LightningMessageReader<OnionMessage> {
const val type: Long = 513

Expand Down
6 changes: 3 additions & 3 deletions src/commonMain/kotlin/fr/acinq/lightning/wire/OnionRouting.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import fr.acinq.lightning.utils.toByteVector32

data class OnionRoutingPacket(
val version: Int,
val publicKey: ByteVector,
val payload: ByteVector,
val hmac: ByteVector32
val publicKey: ByteVector,
val payload: ByteVector,
val hmac: ByteVector32
) {
companion object {
const val PaymentPacketLength = 1300
Expand Down
Loading