Skip to content

Commit 74018b0

Browse files
committed
Rename SpendableOutputDescriptor::outpoint()
We support some languages (okay, just JavaScript) where functions and fields exist in the same namespace. Sadly, because we map enums as base classes with child classes that add additional fields, this requires that fields in enum variants do not have the same name as functions implemented on that enum. We violated this in 0.1.1 with `SpendableOutputDescriptor::outpoint` which aliases the `outpoint` fields on two `SpendableOutputDescriptor` variants. Here we rename the new `outpoint` method, which we'll have to carry on the 0.1-bindings branch in addition to going in 0.2.
1 parent 36ba27a commit 74018b0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lightning/src/sign/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ impl SpendableOutputDescriptor {
534534
}
535535

536536
/// Returns the outpoint of the spendable output.
537-
pub fn outpoint(&self) -> OutPoint {
537+
pub fn spendable_outpoint(&self) -> OutPoint {
538538
match self {
539539
Self::StaticOutput { outpoint, .. } => *outpoint,
540540
Self::StaticPaymentOutput(descriptor) => descriptor.outpoint,

lightning/src/util/sweep.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl TrackedSpendableOutput {
7474

7575
/// Returns whether the output is spent in the given transaction.
7676
pub fn is_spent_in(&self, tx: &Transaction) -> bool {
77-
let prev_outpoint = self.descriptor.outpoint().into_bitcoin_outpoint();
77+
let prev_outpoint = self.descriptor.spendable_outpoint().into_bitcoin_outpoint();
7878
tx.input.iter().any(|input| input.previous_output == prev_outpoint)
7979
}
8080
}

0 commit comments

Comments
 (0)