Skip transactions which are locktime'd when broadcasting in test
[rust-lightning] / lightning / src / util / test_utils.rs
index a1438f3c6ea92a88213c5dff9c8656d431f69ec1..7b9b54fabc2c79f1bff95f44c43ba678b034232d 100644 (file)
@@ -206,6 +206,14 @@ pub struct TestBroadcaster {
 }
 impl chaininterface::BroadcasterInterface for TestBroadcaster {
        fn broadcast_transaction(&self, tx: &Transaction) {
+               assert!(tx.lock_time < 1_500_000_000);
+               if tx.lock_time > self.blocks.lock().unwrap().len() as u32 + 1 && tx.lock_time < 500_000_000 {
+                       for inp in tx.input.iter() {
+                               if inp.sequence != 0xffffffff {
+                                       return;
+                               }
+                       }
+               }
                self.txn_broadcasted.lock().unwrap().push(tx.clone());
        }
 }