-
Notifications
You must be signed in to change notification settings - Fork 404
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
added more clarification #1395
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
/// 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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @TheBlueMatt is this a better description; There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 withscript_pubkey
as/// a spending condition.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 :/