Merge pull request #17 from TheBlueMatt/2017-04-channel-close
[rust-lightning] / src / util / test_utils.rs
index 00f944d0a5fb4cc3348803202756c8e9a60ea256..5d657b13df585922626d37c9950d303838c3d8ae 100644 (file)
@@ -6,6 +6,8 @@ use ln::msgs::HandleError;
 use bitcoin::blockdata::transaction::Transaction;
 use bitcoin::util::hash::Sha256dHash;
 
+use std::sync::Mutex;
+
 pub struct TestFeeEstimator {
        pub sat_per_vbyte: u64,
 }
@@ -26,10 +28,10 @@ impl channelmonitor::ManyChannelMonitor for TestChannelMonitor {
 }
 
 pub struct TestBroadcaster {
-
+       pub txn_broadcasted: Mutex<Vec<Transaction>>,
 }
 impl chaininterface::BroadcasterInterface for TestBroadcaster {
-       fn broadcast_transaction(&self, _tx: &Transaction) {
-               //TODO
+       fn broadcast_transaction(&self, tx: &Transaction) {
+               self.txn_broadcasted.lock().unwrap().push(tx.clone());
        }
 }