Skip to content

Commit c5d7b13

Browse files
authored
Merge pull request #4289 from valentinewallace/2025-12-reconstruct-fwds-followup
Fix double-forward, prefer legacy forward maps
2 parents cef001b + 5a4912c commit c5d7b13

4 files changed

Lines changed: 335 additions & 320 deletions

File tree

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ welcomed.
192192

193193
* `LDK_TEST_DETERMINISTIC_HASHES` - When set to `1`, uses deterministic hash map iteration order in tests. This ensures consistent test output across runs, useful for comparing logs before and after changes.
194194

195+
* `LDK_TEST_REBUILD_MGR_FROM_MONITORS` - If set to `1`, on test node reload the `ChannelManager`'s
196+
HTLC set will be reconstructed from `Channel{Monitor}` persisted data. If `0`, test nodes will be
197+
reloaded from persisted `ChannelManager` data using legacy code paths. This ensures consistent
198+
test output across runs, useful for comparing logs before and after changes, since otherwise the
199+
selection of which codepaths to be used on reload will be chosen randomly.
200+
195201
C/C++ Bindings
196202
--------------
197203

lightning/src/ln/channel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14723,7 +14723,7 @@ where
1472314723
}
1472414724
}
1472514725
let mut removed_htlc_attribution_data: Vec<&Option<AttributionData>> = Vec::new();
14726-
let mut inbound_committed_update_adds: Vec<Option<msgs::UpdateAddHTLC>> = Vec::new();
14726+
let mut inbound_committed_update_adds: Vec<&Option<msgs::UpdateAddHTLC>> = Vec::new();
1472714727
(self.context.pending_inbound_htlcs.len() as u64 - dropped_inbound_htlcs).write(writer)?;
1472814728
for htlc in self.context.pending_inbound_htlcs.iter() {
1472914729
if let &InboundHTLCState::RemoteAnnounced(_) = &htlc.state {
@@ -14745,7 +14745,7 @@ where
1474514745
},
1474614746
&InboundHTLCState::Committed { ref update_add_htlc_opt } => {
1474714747
3u8.write(writer)?;
14748-
inbound_committed_update_adds.push(update_add_htlc_opt.clone());
14748+
inbound_committed_update_adds.push(update_add_htlc_opt);
1474914749
},
1475014750
&InboundHTLCState::LocalRemoved(ref removal_reason) => {
1475114751
4u8.write(writer)?;

0 commit comments

Comments
 (0)