Skip to content

Commit e90f51f

Browse files
committed
f Drop SpendingDelay
1 parent a178a7e commit e90f51f

File tree

1 file changed

+9
-8
lines changed
  • lightning-background-processor/src

1 file changed

+9
-8
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ mod tests {
949949
CHANNEL_MANAGER_PERSISTENCE_PRIMARY_NAMESPACE, CHANNEL_MANAGER_PERSISTENCE_SECONDARY_NAMESPACE, CHANNEL_MANAGER_PERSISTENCE_KEY,
950950
NETWORK_GRAPH_PERSISTENCE_PRIMARY_NAMESPACE, NETWORK_GRAPH_PERSISTENCE_SECONDARY_NAMESPACE, NETWORK_GRAPH_PERSISTENCE_KEY,
951951
SCORER_PERSISTENCE_PRIMARY_NAMESPACE, SCORER_PERSISTENCE_SECONDARY_NAMESPACE, SCORER_PERSISTENCE_KEY};
952-
use lightning::util::sweep::{OutputSweeper, OutputSpendStatus, SpendingDelay};
952+
use lightning::util::sweep::{OutputSweeper, OutputSpendStatus};
953953
use lightning_persister::fs_store::FilesystemStore;
954954
use std::collections::VecDeque;
955955
use std::{fs, env};
@@ -1665,21 +1665,22 @@ mod tests {
16651665
.expect("Events not handled within deadline");
16661666
match event {
16671667
Event::SpendableOutputs { outputs, channel_id } => {
1668-
nodes[0].sweeper.track_spendable_outputs(outputs, channel_id, false, Some(SpendingDelay::Relative { num_blocks: 3 }));
1668+
nodes[0].sweeper.track_spendable_outputs(outputs, channel_id, false, Some(153));
16691669
},
16701670
_ => panic!("Unexpected event: {:?}", event),
16711671
}
16721672

16731673
// Check we don't generate an initial sweeping tx until we reach the required height.
16741674
assert_eq!(nodes[0].sweeper.tracked_spendable_outputs().len(), 1);
16751675
let tracked_output = nodes[0].sweeper.tracked_spendable_outputs().first().unwrap().clone();
1676-
let sweep_tx_0 = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().pop().unwrap();
1677-
assert!(!tracked_output.is_spent_in(&sweep_tx_0));
1678-
match tracked_output.status {
1679-
OutputSpendStatus::PendingInitialBroadcast { delayed_until_height } => {
1680-
assert_eq!(delayed_until_height, Some(153));
1676+
if let Some(sweep_tx_0) = nodes[0].tx_broadcaster.txn_broadcasted.lock().unwrap().pop() {
1677+
assert!(!tracked_output.is_spent_in(&sweep_tx_0));
1678+
match tracked_output.status {
1679+
OutputSpendStatus::PendingInitialBroadcast { delayed_until_height } => {
1680+
assert_eq!(delayed_until_height, Some(153));
1681+
}
1682+
_ => panic!("Unexpected status"),
16811683
}
1682-
_ => panic!("Unexpected status"),
16831684
}
16841685

16851686
advance_chain(&mut nodes[0], 3);

0 commit comments

Comments
 (0)