use bitcoin::blockdata::block::{Block, BlockHeader};
use bitcoin::blockdata::script::Script;
-use bitcoin::blockdata::transaction::TxOut;
+use bitcoin::blockdata::transaction::{Transaction, TxOut};
use bitcoin::hash_types::{BlockHash, Txid};
use chain::channelmonitor::{ChannelMonitor, ChannelMonitorUpdate, ChannelMonitorUpdateErr, MonitorEvent};
/// Registers interest in spends of a transaction output identified by `outpoint` having
/// `script_pubkey` as the spending condition.
- fn register_output(&self, outpoint: &OutPoint, script_pubkey: &Script);
+ ///
+ /// Optionally, returns any transaction dependent on the output. This is useful for Electrum
+ /// clients to facilitate registering in-block descendants.
+ fn register_output(&self, outpoint: &OutPoint, script_pubkey: &Script) -> Option<(usize, Transaction)>;
}
impl<T: Listen> Listen for std::ops::Deref<Target = T> {
self.watched_txn.lock().unwrap().insert((*txid, script_pubkey.clone()));
}
- fn register_output(&self, outpoint: &OutPoint, script_pubkey: &Script) {
+ fn register_output(&self, outpoint: &OutPoint, script_pubkey: &Script) -> Option<(usize, Transaction)> {
self.watched_outputs.lock().unwrap().insert((*outpoint, script_pubkey.clone()));
+ None
}
}