Skip to content

Commit e7560c8

Browse files
committed
Make errors actionable when failing to deserialize a ChannelManager
1 parent f472907 commit e7560c8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4662,6 +4662,8 @@ impl<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
46624662
log_bytes!(channel.channel_id()), monitor.get_latest_update_id(), channel.get_latest_monitor_update_id());
46634663
log_error!(args.logger, " The chain::Watch API *requires* that monitors are persisted durably before returning,");
46644664
log_error!(args.logger, " client applications must ensure that ChannelMonitor data is always available and the latest to avoid funds loss!");
4665+
log_error!(args.logger, " Without the latest ChannelMonitor we cannot continue without risking funds.");
4666+
log_error!(args.logger, " Please ensure the chain::Watch API requirements are met and file a bug report at https://github.com/rust-bitcoin/rust-lightning");
46654667
return Err(DecodeError::InvalidValue);
46664668
} else if channel.get_cur_holder_commitment_transaction_number() > monitor.get_cur_holder_commitment_number() ||
46674669
channel.get_revoked_counterparty_commitment_transaction_number() > monitor.get_min_seen_secret() ||
@@ -4681,6 +4683,8 @@ impl<'a, Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref>
46814683
log_error!(args.logger, "Missing ChannelMonitor for channel {} needed by ChannelManager.", log_bytes!(channel.channel_id()));
46824684
log_error!(args.logger, " The chain::Watch API *requires* that monitors are persisted durably before returning,");
46834685
log_error!(args.logger, " client applications must ensure that ChannelMonitor data is always available and the latest to avoid funds loss!");
4686+
log_error!(args.logger, " Without the ChannelMonitor we cannot continue without risking funds.");
4687+
log_error!(args.logger, " Please ensure the chain::Watch API requirements are met and file a bug report at https://github.com/rust-bitcoin/rust-lightning");
46844688
return Err(DecodeError::InvalidValue);
46854689
}
46864690
}

0 commit comments

Comments
 (0)