@@ -25,8 +25,8 @@ pub enum ChainError {
25
25
/// called from inside the library in response to ChainListener events, P2P events, or timer
26
26
/// events).
27
27
pub trait ChainWatchInterface : Sync + Send {
28
- /// Provides a scriptPubKey which much be watched for.
29
- fn install_watch_script ( & self , script_pub_key : & Script ) ;
28
+ /// Provides a txid/random- scriptPubKey-in-the-tx which much be watched for.
29
+ fn install_watch_tx ( & self , txid : & Sha256dHash , script_pub_key : & Script ) ;
30
30
31
31
/// Provides an outpoint which must be watched for, providing any transactions which spend the
32
32
/// given outpoint.
@@ -54,9 +54,9 @@ pub trait BroadcasterInterface: Sync + Send {
54
54
/// A trait indicating a desire to listen for events from the chain
55
55
pub trait ChainListener : Sync + Send {
56
56
/// Notifies a listener that a block was connected.
57
- /// Note that if a new script/ transaction is watched during a block_connected call, the block
58
- /// *must* be re-scanned with the new script/ transaction and block_connected should be called
59
- /// again with the same header and (at least) the new transactions.
57
+ /// Note that if a new transaction/outpoint is watched during a block_connected call, the block
58
+ /// *must* be re-scanned with the new transaction/outpoints and block_connected should be
59
+ /// called again with the same header and (at least) the new transactions.
60
60
/// This also means those counting confirmations using block_connected callbacks should watch
61
61
/// for duplicate headers and not count them towards confirmations!
62
62
fn block_connected ( & self , header : & BlockHeader , height : u32 , txn_matched : & [ & Transaction ] , indexes_of_txn_matched : & [ u32 ] ) ;
@@ -97,7 +97,7 @@ pub struct ChainWatchInterfaceUtil {
97
97
98
98
/// Register listener
99
99
impl ChainWatchInterface for ChainWatchInterfaceUtil {
100
- fn install_watch_script ( & self , script_pub_key : & Script ) {
100
+ fn install_watch_tx ( & self , _txid : & Sha256dHash , script_pub_key : & Script ) {
101
101
let mut watched = self . watched . lock ( ) . unwrap ( ) ;
102
102
watched. 0 . push ( script_pub_key. clone ( ) ) ;
103
103
self . reentered . fetch_add ( 1 , Ordering :: Relaxed ) ;
0 commit comments