Skip to content

Commit 5791eab

Browse files
committed
f clean up bool setting
1 parent c0c63cd commit 5791eab

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -616,10 +616,9 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
616616
for dest in nodes.iter() {
617617
if dest.get_our_node_id() == node_id {
618618
assert!(update_fee.is_none());
619-
let mut processed_change = false;
620-
for update_add in update_add_htlcs {
619+
for update_add in update_add_htlcs.iter() {
621620
if !$corrupt_forward {
622-
dest.handle_update_add_htlc(&nodes[$node].get_our_node_id(), &update_add);
621+
dest.handle_update_add_htlc(&nodes[$node].get_our_node_id(), update_add);
623622
} else {
624623
// Corrupt the update_add_htlc message so that its HMAC
625624
// check will fail and we generate a
@@ -630,20 +629,18 @@ pub fn do_test<Out: test_logger::Output>(data: &[u8], out: Out) {
630629
let new_msg = UpdateAddHTLC::read(&mut Cursor::new(&msg_ser)).unwrap();
631630
dest.handle_update_add_htlc(&nodes[$node].get_our_node_id(), &new_msg);
632631
}
633-
processed_change = true;
634632
}
635-
for update_fulfill in update_fulfill_htlcs {
636-
dest.handle_update_fulfill_htlc(&nodes[$node].get_our_node_id(), &update_fulfill);
637-
processed_change = true;
633+
for update_fulfill in update_fulfill_htlcs.iter() {
634+
dest.handle_update_fulfill_htlc(&nodes[$node].get_our_node_id(), update_fulfill);
638635
}
639-
for update_fail in update_fail_htlcs {
640-
dest.handle_update_fail_htlc(&nodes[$node].get_our_node_id(), &update_fail);
641-
processed_change = true;
636+
for update_fail in update_fail_htlcs.iter() {
637+
dest.handle_update_fail_htlc(&nodes[$node].get_our_node_id(), update_fail);
642638
}
643-
for update_fail_malformed in update_fail_malformed_htlcs {
644-
dest.handle_update_fail_malformed_htlc(&nodes[$node].get_our_node_id(), &update_fail_malformed);
645-
processed_change = true;
639+
for update_fail_malformed in update_fail_malformed_htlcs.iter() {
640+
dest.handle_update_fail_malformed_htlc(&nodes[$node].get_our_node_id(), update_fail_malformed);
646641
}
642+
let processed_change = !update_add_htlcs.is_empty() || !update_fulfill_htlcs.is_empty() ||
643+
!update_fail_htlcs.is_empty() || !update_fail_malformed_htlcs.is_empty();
647644
if $limit_events != ProcessMessages::AllMessages && processed_change {
648645
// If we only want to process some messages, don't deliver the CS until later.
649646
extra_ev = Some(events::MessageSendEvent::UpdateHTLCs { node_id, updates: CommitmentUpdate {

0 commit comments

Comments
 (0)