Expose additional FundingContribution accessors
What changed, and why it matters
This commit adds public getter methods to expose more details of a FundingContribution object in the Lightning Dev Kit library. It is a straightforward API visibility change that lets downstream users read fee, input, and feerate information without inspecting raw transaction data. There is no security-relevant change in behavior.
No security action required. Treat as a normal API enhancement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch exposes three new public accessors on FundingContribution—estimated_fee(), inputs(), and max_feerate()—and changes feerate() from pub(super) to pub. These are read-only getters returning existing private fields. No logic, validation, or permission model is altered.
Changed components
lightning/src/ln/funding.rsInspect captured patch +21 / −4
diff --git a/lightning/src/ln/funding.rs b/lightning/src/ln/funding.rs
index aa5a854..a4a5eb2 100644
--- a/lightning/src/ln/funding.rs
+++ b/lightning/src/ln/funding.rs
@@ -578,10 +578,6 @@ impl_writeable_tlv_based!(FundingContribution, {
});
impl FundingContribution {
- pub(super) fn feerate(&self) -> FeeRate {
- self.feerate
- }
-
pub(super) fn is_splice(&self) -> bool {
self.is_splice
}
@@ -610,6 +606,16 @@ impl FundingContribution {
.unwrap_or(Amount::ZERO)
}
+ /// Returns the estimated on-chain fee this contribution is responsible for paying.
+ pub fn estimated_fee(&self) -> Amount {
+ self.estimated_fee
+ }
+
+ /// Returns the inputs included in this contribution.
+ pub fn inputs(&self) -> &[FundingTxInput] {
+ &self.inputs
+ }
+
/// Returns the outputs (e.g., withdrawal destinations) included in this contribution.
///
/// This does not include the change output; see [`FundingContribution::change_output`].
@@ -625,6 +631,17 @@ impl FundingContribution {
self.change_output.as_ref()
}
+ /// Returns the fee rate used to select `inputs` (the minimum feerate).
+ pub fn feerate(&self) -> FeeRate {
+ self.feerate
+ }
+
+ /// Returns the maximum fee rate this contribution will accept as acceptor before rejecting
+ /// the splice.
+ pub fn max_feerate(&self) -> FeeRate {
+ self.max_feerate
+ }
+
/// Tries to satisfy a new request using only this contribution's existing inputs.
///
/// For input-backed contributions, this reuses the current inputs, adjusts the explicit
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.