Skip to content
Closed
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 @@ -87,9 +87,7 @@ sealed class ChannelAction {
abstract val txId: TxId
data class ViaSpliceOut(val amount: Satoshi, override val miningFees: Satoshi, val address: String, override val txId: TxId) : StoreOutgoingPayment()
data class ViaSpliceCpfp(override val miningFees: Satoshi, override val txId: TxId) : StoreOutgoingPayment()
data class ViaInboundLiquidityRequest(override val txId: TxId, val lease: LiquidityAds.Lease) : StoreOutgoingPayment() {
override val miningFees: Satoshi = lease.fees.miningFee
}
data class ViaInboundLiquidityRequest(override val miningFees: Satoshi, override val txId: TxId, val lease: LiquidityAds.Lease) : StoreOutgoingPayment()
data class ViaClose(val amount: Satoshi, override val miningFees: Satoshi, val address: String, override val txId: TxId, val isSentToDefaultAddress: Boolean, val closingType: ChannelClosingType) : StoreOutgoingPayment()
}
data class SetLocked(val txId: TxId) : Storage()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ data class Normal(
)
)
liquidityLease?.let {
add(ChannelAction.Storage.StoreOutgoingPayment.ViaInboundLiquidityRequest(txId = action.fundingTx.txId, lease = it))
add(ChannelAction.Storage.StoreOutgoingPayment.ViaInboundLiquidityRequest(miningFees = action.fundingTx.sharedTx.tx.fees, txId = action.fundingTx.txId, lease = it))
Copy link
Copy Markdown
Member

@t-bast t-bast Dec 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what the miningFees here should be, there are two different choices: see #561 (comment) for more details.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, following up on the parent PR.

}
if (staticParams.useZeroConf) {
logger.info { "channel is using 0-conf, sending splice_locked right away" }
Expand Down
6 changes: 3 additions & 3 deletions src/commonMain/kotlin/fr/acinq/lightning/db/PaymentsDb.kt
Original file line number Diff line number Diff line change
Expand Up @@ -390,16 +390,16 @@ data class SpliceCpfpOutgoingPayment(

data class InboundLiquidityOutgoingPayment(
override val id: UUID,
override val miningFees: Satoshi,
override val channelId: ByteVector32,
override val txId: TxId,
val lease: LiquidityAds.Lease,
override val createdAt: Long,
override val confirmedAt: Long?,
override val lockedAt: Long?,
) : OnChainOutgoingPayment() {
override val amount: MilliSatoshi = lease.fees.total.toMilliSatoshi()
override val miningFees: Satoshi = lease.fees.miningFee
override val fees: MilliSatoshi = lease.fees.total.toMilliSatoshi()
override val amount: MilliSatoshi = (lease.fees.serviceFee + miningFees).toMilliSatoshi()
override val fees: MilliSatoshi = miningFees.toMilliSatoshi()
override val completedAt: Long? = confirmedAt
}

Expand Down
1 change: 1 addition & 0 deletions src/commonMain/kotlin/fr/acinq/lightning/io/Peer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ class Peer(
is ChannelAction.Storage.StoreOutgoingPayment.ViaInboundLiquidityRequest ->
InboundLiquidityOutgoingPayment(
id = UUID.randomUUID(),
miningFees = action.miningFees,
channelId = channelId,
txId = action.txId,
lease = action.lease,
Expand Down