From 71c76068b5e1f368d52e335e48d704a34878b2c1 Mon Sep 17 00:00:00 2001 From: Jeffrey Czyz Date: Fri, 7 Aug 2020 15:13:57 -0700 Subject: [PATCH] WIP: Remove ChainWatchedUtil --- lightning/src/chain/chaininterface.rs | 92 ------------------- lightning/src/chain/channelmonitor.rs | 124 +++++--------------------- lightning/src/chain/mod.rs | 4 +- lightning/src/util/test_utils.rs | 4 +- 4 files changed, 27 insertions(+), 197 deletions(-) diff --git a/lightning/src/chain/chaininterface.rs b/lightning/src/chain/chaininterface.rs index f9f725421..22904a017 100644 --- a/lightning/src/chain/chaininterface.rs +++ b/lightning/src/chain/chaininterface.rs @@ -5,10 +5,6 @@ //! disconnections, transaction broadcasting, and feerate information requests. use bitcoin::blockdata::transaction::Transaction; -use bitcoin::blockdata::script::Script; -use bitcoin::hash_types::Txid; - -use std::collections::HashSet; /// An interface to send a transaction to the Bitcoin network. pub trait BroadcasterInterface: Sync + Send { @@ -46,91 +42,3 @@ pub trait FeeEstimator: Sync + Send { /// Minimum relay fee as required by bitcoin network mempool policy. pub const MIN_RELAY_FEE_SAT_PER_1000_WEIGHT: u64 = 4000; - -/// Utility for tracking registered txn/outpoints and checking for matches -#[cfg_attr(test, derive(PartialEq))] -pub struct ChainWatchedUtil { - watch_all: bool, - - // We are more conservative in matching during testing to ensure everything matches *exactly*, - // even though during normal runtime we take more optimized match approaches... - #[cfg(test)] - watched_txn: HashSet<(Txid, Script)>, - #[cfg(not(test))] - watched_txn: HashSet