Remove TestBroadcaster temporary dedup buffer
[rust-lightning] / lightning / src / util / test_utils.rs
index 9af8d5cf2f3d92db21ab81a775ae4b1b03ad8860..78b81fa637bf292deda5b5a9244512cbbd2d6c8f 100644 (file)
@@ -22,7 +22,7 @@ use secp256k1::{SecretKey, PublicKey};
 use std::time::{SystemTime, UNIX_EPOCH};
 use std::sync::{Arc,Mutex};
 use std::{mem};
-use std::collections::{HashMap, HashSet};
+use std::collections::HashMap;
 
 pub struct TestVecWriter(pub Vec<u8>);
 impl Writer for TestVecWriter {
@@ -108,19 +108,9 @@ impl<'a> channelmonitor::ManyChannelMonitor<EnforcingChannelKeys> for TestChanne
 
 pub struct TestBroadcaster {
        pub txn_broadcasted: Mutex<Vec<Transaction>>,
-       pub broadcasted_txn: Mutex<HashSet<Sha256dHash>> // Temporary field while refactoring out tx duplication
 }
 impl chaininterface::BroadcasterInterface for TestBroadcaster {
        fn broadcast_transaction(&self, tx: &Transaction) {
-               {
-                       if let Some(_) = self.broadcasted_txn.lock().unwrap().get(&tx.txid()) {
-                               // If commitment tx, HTLC-timeout or HTLC-Success, duplicate broadcast are still ok
-                               if tx.input[0].sequence == 0xfffffffd {
-                                       return;
-                               }
-                       }
-               }
-               self.broadcasted_txn.lock().unwrap().insert(tx.txid());
                self.txn_broadcasted.lock().unwrap().push(tx.clone());
        }
 }