1 use bitcoin::blockdata::transaction::Transaction;
2 use bitcoin::blockdata::script::Script;
3 use bitcoin::util::hash::Sha256dHash;
5 use chain::chaininterface::{ChainWatchInterface,ChainWatchInterfaceUtil,ChainListener, BroadcasterInterface};
9 pub struct BitcoinCoreRPCClientChain {
10 util: ChainWatchInterfaceUtil
13 impl ChainWatchInterface for BitcoinCoreRPCClientChain {
14 fn install_watch_script(&self, spk: Script) {
15 self.util.install_watch_script(spk)
18 fn install_watch_outpoint(&self, outpoint: (Sha256dHash, u32)) {
19 self.util.install_watch_outpoint(outpoint)
22 fn watch_all_txn(&self) {
23 self.util.watch_all_txn()
26 fn register_listener(&self, listener: Weak<ChainListener>) {
27 self.util.register_listener(listener)
31 impl BroadcasterInterface for BitcoinCoreRPCClientChain {
32 fn broadcast_transaction(&self, _tx: &Transaction) {
37 impl BitcoinCoreRPCClientChain {
38 pub fn new() -> BitcoinCoreRPCClientChain {
39 BitcoinCoreRPCClientChain {
40 util: ChainWatchInterfaceUtil::new(),