[−][src]Trait lightning::chain::chaininterface::ChainWatchInterface
An interface to request notification of certain scripts as they appear the chain.
Note that all of the functions implemented here must be reentrant-safe (obviously - they're called from inside the library in response to ChainListener events, P2P events, or timer events).
Required methods
fn install_watch_tx(&self, txid: &Sha256dHash, script_pub_key: &Script)
Provides a txid/random-scriptPubKey-in-the-tx which much be watched for.
fn install_watch_outpoint(
&self,
outpoint: (Sha256dHash, u32),
out_script: &Script
)
&self,
outpoint: (Sha256dHash, u32),
out_script: &Script
)
Provides an outpoint which must be watched for, providing any transactions which spend the given outpoint.
fn watch_all_txn(&self)
Indicates that a listener needs to see all transactions.
fn register_listener(&self, listener: Weak<dyn ChainListener>)
Register the given listener to receive events. Only a weak pointer is provided and the registration should be freed once that pointer expires.
fn get_chain_utxo(
&self,
genesis_hash: Sha256dHash,
unspent_tx_output_identifier: u64
) -> Result<(Script, u64), ChainError>
&self,
genesis_hash: Sha256dHash,
unspent_tx_output_identifier: u64
) -> Result<(Script, u64), ChainError>
Gets the script and value in satoshis for a given unspent transaction output given a short_channel_id (aka unspent_tx_output_identier). For BTC/tBTC channels the top three bytes are the block height, the next 3 the transaction index within the block, and the final two the output within the transaction.
Implementors
impl ChainWatchInterface for ChainWatchInterfaceUtil
[src]
impl ChainWatchInterface for ChainWatchInterfaceUtil
Register listener
fn install_watch_tx(&self, txid: &Sha256dHash, script_pub_key: &Script) | [src] |
fn install_watch_outpoint( | [src] |
fn watch_all_txn(&self) | [src] |
fn register_listener(&self, listener: Weak<dyn ChainListener>) | [src] |
fn get_chain_utxo( | [src] |