mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-03-15 15:39:09 +01:00
Merge pull request #3367 from TheBlueMatt/2024-10-dense-counters
Don't bump the `next_node_counter` when using a removed counter
This commit is contained in:
commit
299b7bd714
1 changed files with 3 additions and 3 deletions
|
@ -2077,9 +2077,9 @@ where
|
||||||
},
|
},
|
||||||
IndexedMapEntry::Vacant(node_entry) => {
|
IndexedMapEntry::Vacant(node_entry) => {
|
||||||
let mut removed_node_counters = self.removed_node_counters.lock().unwrap();
|
let mut removed_node_counters = self.removed_node_counters.lock().unwrap();
|
||||||
**chan_info_node_counter = removed_node_counters
|
**chan_info_node_counter = removed_node_counters.pop().unwrap_or_else(|| {
|
||||||
.pop()
|
self.next_node_counter.fetch_add(1, Ordering::Relaxed) as u32
|
||||||
.unwrap_or(self.next_node_counter.fetch_add(1, Ordering::Relaxed) as u32);
|
});
|
||||||
node_entry.insert(NodeInfo {
|
node_entry.insert(NodeInfo {
|
||||||
channels: vec![short_channel_id],
|
channels: vec![short_channel_id],
|
||||||
announcement_info: None,
|
announcement_info: None,
|
||||||
|
|
Loading…
Add table
Reference in a new issue