Skip to content

Commit

Permalink
Fix monitor persisting
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Oct 2, 2023
1 parent 42b2208 commit 707eb3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mutiny-core/src/ldkstorage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl<S: MutinyStorage> MutinyNodePersister<S> {
spawn(async move {
// Sleep before persisting to give chance for the manager to be persisted
sleep(50).await;
match persist_local_storage(&storage, &key, &object, Some(version), &logger).await {
match persist_local_storage(&storage, &key, object, Some(version), &logger).await {
Ok(()) => {
log_debug!(logger, "Persisted channel monitor: {update_id:?}");

Expand Down Expand Up @@ -721,15 +721,15 @@ pub struct MonitorUpdateIdentifier {
pub monitor_update_id: MonitorUpdateId,
}

async fn persist_local_storage<W: Writeable>(
async fn persist_local_storage(
storage: &impl MutinyStorage,
key: &str,
object: &W,
object: Vec<u8>,
version: Option<u32>,
logger: &MutinyLogger,
) -> Result<(), lightning::io::Error> {
storage
.set_data_async(key, object.encode(), version)
.set_data_async(key, object, version)
.map_err(|e| {
match e {
MutinyError::PersistenceFailed { source } => {
Expand Down

0 comments on commit 707eb3d

Please sign in to comment.