Skip to content

Commit 1d36f7b

Browse files
jkczyzclaude
andcommitted
Expose additional FundingContribution accessors
Add public getters for `estimated_fee`, `inputs`, and `max_feerate`, and elevate `feerate` from `pub(super)` to `pub`. Together with the existing `value_added`, `outputs`, and `change_output`, this gives downstream consumers of `TransactionType::Splice` (notably LDK Node, which updates `PaymentDetails` from the broadcast callback) the data they need without reaching into the raw transaction. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0d2ac33 commit 1d36f7b

1 file changed

Lines changed: 21 additions & 4 deletions

File tree

lightning/src/ln/funding.rs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,10 +578,6 @@ impl_writeable_tlv_based!(FundingContribution, {
578578
});
579579

580580
impl FundingContribution {
581-
pub(super) fn feerate(&self) -> FeeRate {
582-
self.feerate
583-
}
584-
585581
pub(super) fn is_splice(&self) -> bool {
586582
self.is_splice
587583
}
@@ -610,6 +606,16 @@ impl FundingContribution {
610606
.unwrap_or(Amount::ZERO)
611607
}
612608

609+
/// Returns the estimated on-chain fee this contribution is responsible for paying.
610+
pub fn estimated_fee(&self) -> Amount {
611+
self.estimated_fee
612+
}
613+
614+
/// Returns the inputs included in this contribution.
615+
pub fn inputs(&self) -> &[FundingTxInput] {
616+
&self.inputs
617+
}
618+
613619
/// Returns the outputs (e.g., withdrawal destinations) included in this contribution.
614620
///
615621
/// This does not include the change output; see [`FundingContribution::change_output`].
@@ -625,6 +631,17 @@ impl FundingContribution {
625631
self.change_output.as_ref()
626632
}
627633

634+
/// Returns the fee rate used to select `inputs` (the minimum feerate).
635+
pub fn feerate(&self) -> FeeRate {
636+
self.feerate
637+
}
638+
639+
/// Returns the maximum fee rate this contribution will accept as acceptor before rejecting
640+
/// the splice.
641+
pub fn max_feerate(&self) -> FeeRate {
642+
self.max_feerate
643+
}
644+
628645
/// Tries to satisfy a new request using only this contribution's existing inputs.
629646
///
630647
/// For input-backed contributions, this reuses the current inputs, adjusts the explicit

0 commit comments

Comments
 (0)