Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 480
Drop return value from Filter::register_output#1663
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
Merged
TheBlueMatt
merged 2 commits into
lightningdevkit:main
from
tnull:2022-08-drop-register-output-returnAug 15, 2022
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -12,7 +12,7 @@ | ||
| use bitcoin::blockdata::block::{Block, BlockHeader}; | ||
| use bitcoin::blockdata::constants::genesis_block; | ||
| use bitcoin::blockdata::script::Script; | ||
| use bitcoin::blockdata::transaction::{Transaction, TxOut}; | ||
| use bitcoin::blockdata::transaction::TxOut; | ||
| use bitcoin::hash_types::{BlockHash, Txid}; | ||
| use bitcoin::network::constants::Network; | ||
| use bitcoin::secp256k1::PublicKey; | ||
| @@ -151,15 +151,15 @@ pub trait Confirm { | ||
| /// in the event of a chain reorganization, it must not be called with a `header` that is no | ||
| /// longer in the chain as of the last call to [`best_block_updated`]. | ||
| /// | ||
| /// [chain order]: Confirm#Order | ||
| /// [chain order]: Confirm#order | ||
| /// [`best_block_updated`]: Self::best_block_updated | ||
| fn transactions_confirmed(&self, header: &BlockHeader, txdata: &TransactionData, height: u32); | ||
| /// Processes a transaction that is no longer confirmed as result of a chain reorganization. | ||
| /// | ||
| /// Should be called for any transaction returned by [`get_relevant_txids`] if it has been | ||
| /// reorganized out of the best chain. Once called, the given transaction should not be returned | ||
| /// by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`]. | ||
| /// reorganized out of the best chain. Once called, the given transaction will not be returned | ||
| /// by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`]. | ||
| /// | ||
| /// [`get_relevant_txids`]: Self::get_relevant_txids | ||
| /// [`transactions_confirmed`]: Self::transactions_confirmed | ||
| @@ -173,9 +173,9 @@ pub trait Confirm { | ||
| /// Returns transactions that should be monitored for reorganization out of the chain. | ||
| /// | ||
| /// Should include any transactions passed to [`transactions_confirmed`] that have insufficient | ||
| /// confirmations to be safe from a chain reorganization. Should not include any transactions | ||
| /// passed to [`transaction_unconfirmed`] unless later reconfirmed. | ||
| /// Will include any transactions passed to [`transactions_confirmed`] that have insufficient | ||
| /// confirmations to be safe from a chain reorganization. Will not include any transactions | ||
| /// passed to [`transaction_unconfirmed`], unless later reconfirmed. | ||
| /// | ||
| /// May be called to determine the subset of transactions that must still be monitored for | ||
| /// reorganization. Will be idempotent between calls but may change as a result of calls to the | ||
| @@ -333,21 +333,18 @@ pub trait Filter { | ||
| /// Registers interest in spends of a transaction output. | ||
| /// | ||
| /// 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. | ||
| /// | ||
| /// This return value is useful for Electrum clients in order to supply in-block descendant | ||
| /// transactions which otherwise were not included. This is not necessary for other clients if | ||
| /// such descendant transactions were already included (e.g., when a BIP 157 client provides the | ||
| /// full block). | ||
| fn register_output(&self, output: WatchedOutput) -> Option<(usize, Transaction)>; | ||
| /// Note that this method might be called during processing of a new block. You therefore need | ||
| /// to ensure that also dependent output spents within an already connected block are correctly | ||
| /// handled, e.g., by re-scanning the block in question whenever new outputs have been | ||
| /// registered mid-processing. | ||
| fn register_output(&self, output: WatchedOutput); | ||
| } | ||
| /// A transaction output watched by a [`ChannelMonitor`] for spends on-chain. | ||
| /// | ||
| /// Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction | ||
| /// spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via | ||
| /// the return value of [`Filter::register_output`]. | ||
| /// [`Confirm::transactions_confirmed`]. | ||
| /// | ||
| /// If `block_hash` is `Some`, this indicates the output was created in the corresponding block and | ||
| /// may have been spent there. See [`Filter::register_output`] for details. | ||
tnull marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.