Skip to content

added more clarification #1395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lightning/src/chain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,12 @@ pub trait Watch<ChannelSigner: Sign> {
/// [BIP 157]: https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki
/// [BIP 158]: https://github.com/bitcoin/bips/blob/master/bip-0158.mediawiki
pub trait Filter {
/// Registers interest in a transaction with `txid` and having an output with `script_pubkey` as
/// Registers interest in funding transactions to inform LDK that a channel
/// Funding transaction is transaction with `txid` and having an output with `script_pubkey` as
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to narrow the definition of this function to only funding transaction(s). Yes, it's true today, but specifying it in the docs and committing to it I don't think we want to do.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be a better description that clarifies and differentiates what it does with register_output

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key difference here is one looks at a given transaction being broadcasted, one looks for spends of a given output being broadcasted.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheBlueMatt, should I go with this;

/// Registers interest in transactions to inform LDK that a channel.
/// Transactions with txid and having an output with script_pubkey as
/// a spending condition.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think these functions should have any reference to what kind of transaction it is (channel/close/open/etc).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I should leave them at what they were?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean I do think they need to be clarified, because we've seen a good chunk of confusion on them, but it remains entirely unclear to me exactly how they should be clarified :/

/// a spending condition.
fn register_tx(&self, txid: &Txid, script_pubkey: &Script);

/// Registers interest in spends of a transaction output.
/// Registers interest in spends of a force close transaction.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't just about force-closure transactions - we also use it to detect normal closures, etc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheBlueMatt is this a better description; Registers interest in spends of a closing transaction.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not "spends of a closing transaction", though, its "spends of a given outpoint", ie any time a given output is spent we care.

///
/// Optionally, when `output.block_hash` is set, should return any transaction spending the
/// output that is found in the corresponding block along with its index.
Expand Down