Skip to content

Commit 86dcede

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 35a480a commit 86dcede

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
@@ -710,10 +710,6 @@ impl_writeable_tlv_based!(FundingContribution, {
710710
});
711711

712712
impl FundingContribution {
713-
pub(super) fn feerate(&self) -> FeeRate {
714-
self.feerate
715-
}
716-
717713
pub(super) fn is_splice(&self) -> bool {
718714
self.is_splice
719715
}
@@ -731,6 +727,16 @@ impl FundingContribution {
731727
self.value_added
732728
}
733729

730+
/// Returns the estimated on-chain fee this contribution is responsible for paying.
731+
pub fn estimated_fee(&self) -> Amount {
732+
self.estimated_fee
733+
}
734+
735+
/// Returns the inputs included in this contribution.
736+
pub fn inputs(&self) -> &[FundingTxInput] {
737+
&self.inputs
738+
}
739+
734740
/// Returns the outputs (e.g., withdrawal destinations) included in this contribution.
735741
///
736742
/// This does not include the change output; see [`FundingContribution::change_output`].
@@ -746,6 +752,17 @@ impl FundingContribution {
746752
self.change_output.as_ref()
747753
}
748754

755+
/// Returns the fee rate used to select `inputs` (the minimum feerate).
756+
pub fn feerate(&self) -> FeeRate {
757+
self.feerate
758+
}
759+
760+
/// Returns the maximum fee rate this contribution will accept as acceptor before rejecting
761+
/// the splice.
762+
pub fn max_feerate(&self) -> FeeRate {
763+
self.max_feerate
764+
}
765+
749766
pub(super) fn into_tx_parts(self) -> (Vec<FundingTxInput>, Vec<TxOut>) {
750767
let FundingContribution { inputs, mut outputs, change_output, .. } = self;
751768

0 commit comments

Comments
 (0)