Skip to content

Commit 78174f3

Browse files
authored
Merge pull request #1332 from TheBlueMatt/2022-02-persister-ignore-tmp
Ignore .tmp files when loading ChannelMonitors in persister
2 parents 4b77ce1 + a2a90ee commit 78174f3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lightning-persister/src/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,12 @@ impl FilesystemPersister {
122122
"Invalid ChannelMonitor file name",
123123
));
124124
}
125+
if filename.unwrap().ends_with(".tmp") {
126+
// If we were in the middle of committing an new update and crashed, it should be
127+
// safe to ignore the update - we should never have returned to the caller and
128+
// irrevocably committed to the new state in any way.
129+
continue;
130+
}
125131

126132
let txid = Txid::from_hex(filename.unwrap().split_at(64).0);
127133
if txid.is_err() {

0 commit comments

Comments
 (0)