Skip to content

Commit 43d8fa1

Browse files
committed
Expose channel_funding_fee_sats_per_kwu on Node
Add a narrow public accessor that returns the current ChannelFunding fee-rate estimate in sat/kwu. The underlying OnchainFeeEstimator and ConfirmationTarget remain pub(crate); this method gives downstream callers (mdkd's auto-splice manager) just the scalar they need to budget on-chain fees for splice transactions without depending on internal types. Returning sat/kwu rather than a FeeRate struct keeps the surface type-stable across bitcoin/rust-lightning bumps and matches the unit ldk-node already uses internally for ChannelFunding. NOTE: Can drop this commit after upgrading fork to 0.8.0
1 parent 5baa1f8 commit 43d8fa1

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,6 +1798,17 @@ impl Node {
17981798
self.keys_manager.verify_signature(msg, sig, pkey)
17991799
}
18001800

1801+
/// Returns the current fee-rate estimate (in sats per 1000 weight units) for channel
1802+
/// funding transactions.
1803+
///
1804+
/// Useful for callers that need to budget on-chain fees for splice or open-channel
1805+
/// operations without round-tripping through the on-chain wallet API.
1806+
pub fn channel_funding_fee_sats_per_kwu(&self) -> u64 {
1807+
self.fee_estimator
1808+
.estimate_fee_rate(ConfirmationTarget::ChannelFunding)
1809+
.to_sat_per_kwu()
1810+
}
1811+
18011812
/// Exports the current state of the scorer. The result can be shared with and merged by light nodes that only have
18021813
/// a limited view of the network.
18031814
pub fn export_pathfinding_scores(&self) -> Result<Vec<u8>, Error> {

0 commit comments

Comments
 (0)