@@ -15,21 +15,23 @@ class LdkFeeEstimator: FeeEstimator {
1515 private var minAllowedAnchorChannelRemoteFee : UInt32 = 0
1616 private var onChainSweep : UInt32 = 0
1717 private var minAllowedNonAnchorChannelRemoteFee : UInt32 = 0
18-
19- func update( anchorChannelFee: UInt32 , nonAnchorChannelFee: UInt32 , channelCloseMinimum: UInt32 , minAllowedAnchorChannelRemoteFee: UInt32 , onChainSweep: UInt32 , minAllowedNonAnchorChannelRemoteFee: UInt32 ) {
18+ private var outputSpendingFee : UInt32 = 0
19+
20+ func update( anchorChannelFee: UInt32 , nonAnchorChannelFee: UInt32 , channelCloseMinimum: UInt32 , minAllowedAnchorChannelRemoteFee: UInt32 , onChainSweep: UInt32 , minAllowedNonAnchorChannelRemoteFee: UInt32 , outputSpendingFee: UInt32 ) {
2021 self . anchorChannelFee = anchorChannelFee
2122 self . nonAnchorChannelFee = nonAnchorChannelFee
2223 self . channelCloseMinimum = channelCloseMinimum
2324 self . minAllowedAnchorChannelRemoteFee = minAllowedAnchorChannelRemoteFee
2425 self . onChainSweep = onChainSweep
2526 self . minAllowedNonAnchorChannelRemoteFee = minAllowedNonAnchorChannelRemoteFee
27+ self . outputSpendingFee = outputSpendingFee
2628
2729 LdkEventEmitter . shared. send ( withEvent: . native_log, body: " Fee estimator updated " )
2830 }
29-
31+
3032 override func getEstSatPer1000Weight( confirmationTarget: Bindings . ConfirmationTarget ) -> UInt32 {
3133 let target = confirmationTarget
32-
34+
3335 switch target {
3436 case . AnchorChannelFee:
3537 return anchorChannelFee
@@ -43,9 +45,8 @@ class LdkFeeEstimator: FeeEstimator {
4345 return onChainSweep
4446 case . MinAllowedNonAnchorChannelRemoteFee:
4547 return minAllowedNonAnchorChannelRemoteFee
46- @unknown default :
47- LdkEventEmitter . shared. send ( withEvent: . native_log, body: " ERROR: New ConfirmationTarget added. Update LdkFeeEstimator. " )
48- return 0
48+ case . OutputSpendingFee:
49+ return outputSpendingFee
4950 }
5051 }
5152}
0 commit comments