Skip to content

Commit 99fb6f1

Browse files
committed
f - remove extra string allocations
1 parent ec05d14 commit 99fb6f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lightning/src/util/persist.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,10 +752,10 @@ where
752752
) -> chain::ChannelMonitorUpdateStatus {
753753
const LEGACY_CLOSED_CHANNEL_UPDATE_ID: u64 = u64::MAX;
754754
if let Some(update) = update {
755-
let monitor_key = monitor_name.to_string();
756755
let persist_update = update.update_id != LEGACY_CLOSED_CHANNEL_UPDATE_ID
757756
&& update.update_id % self.maximum_pending_updates != 0;
758757
if persist_update {
758+
let monitor_key = monitor_name.to_string();
759759
let update_name = UpdateName::from(update.update_id);
760760
match self.kv_store.write(
761761
CHANNEL_MONITOR_UPDATE_PERSISTENCE_PRIMARY_NAMESPACE,
@@ -781,6 +781,7 @@ where
781781
// the new one in order to determine the cleanup range.
782782
let maybe_old_monitor = match monitor.get_latest_update_id() {
783783
LEGACY_CLOSED_CHANNEL_UPDATE_ID => {
784+
let monitor_key = monitor_name.to_string();
784785
self.read_monitor(&monitor_name, &monitor_key).ok()
785786
},
786787
_ => None,

0 commit comments

Comments
 (0)