Skip to content

Commit bf51037

Browse files
committed
f Account for sub-namespaces
1 parent 8184092 commit bf51037

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lightning/src/util/persist.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ where
199199
{
200200
let mut res = Vec::new();
201201

202-
for stored_key in kv_store.list(CHANNEL_MONITOR_PERSISTENCE_NAMESPACE)? {
202+
for stored_key in kv_store.list(
203+
CHANNEL_MONITOR_PERSISTENCE_NAMESPACE, CHANNEL_MONITOR_PERSISTENCE_SUB_NAMESPACE)?
204+
{
203205
let txid = Txid::from_hex(stored_key.split_at(64).0).map_err(|_| {
204206
io::Error::new(io::ErrorKind::InvalidData, "Invalid tx ID in stored key")
205207
})?;
@@ -209,7 +211,8 @@ where
209211
})?;
210212

211213
match <(BlockHash, ChannelMonitor<<SP::Target as SignerProvider>::Signer>)>::read(
212-
&mut io::Cursor::new(kv_store.read(CHANNEL_MONITOR_PERSISTENCE_NAMESPACE, &stored_key)?),
214+
&mut io::Cursor::new(
215+
kv_store.read(CHANNEL_MONITOR_PERSISTENCE_NAMESPACE, CHANNEL_MONITOR_PERSISTENCE_SUB_NAMESPACE, &stored_key)?),
213216
(&*entropy_source, &*signer_provider),
214217
) {
215218
Ok((block_hash, channel_monitor)) => {

0 commit comments

Comments
 (0)