@@ -261,11 +261,11 @@ impl<ChannelSigner: EcdsaChannelSigner, K: KVStore + ?Sized> Persist<ChannelSign
261
261
fn persist_new_channel (
262
262
& self , funding_txo : OutPoint , monitor : & ChannelMonitor < ChannelSigner > ,
263
263
) -> chain:: ChannelMonitorUpdateStatus {
264
- let key = format ! ( "{}_{}" , funding_txo. txid . to_string ( ) , funding_txo . index ) ;
264
+ let monitor_name = MonitorName :: from ( funding_txo) ;
265
265
match self . write (
266
266
CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE ,
267
267
CHANNEL_MONITOR_PERSISTENCE_SECONDARY_NAMESPACE ,
268
- & key ,
268
+ monitor_name . as_str ( ) ,
269
269
& monitor. encode ( ) ,
270
270
) {
271
271
Ok ( ( ) ) => chain:: ChannelMonitorUpdateStatus :: Completed ,
@@ -277,11 +277,11 @@ impl<ChannelSigner: EcdsaChannelSigner, K: KVStore + ?Sized> Persist<ChannelSign
277
277
& self , funding_txo : OutPoint , _update : Option < & ChannelMonitorUpdate > ,
278
278
monitor : & ChannelMonitor < ChannelSigner > ,
279
279
) -> chain:: ChannelMonitorUpdateStatus {
280
- let key = format ! ( "{}_{}" , funding_txo. txid . to_string ( ) , funding_txo . index ) ;
280
+ let monitor_name = MonitorName :: from ( funding_txo) ;
281
281
match self . write (
282
282
CHANNEL_MONITOR_PERSISTENCE_PRIMARY_NAMESPACE ,
283
283
CHANNEL_MONITOR_PERSISTENCE_SECONDARY_NAMESPACE ,
284
- & key ,
284
+ monitor_name . as_str ( ) ,
285
285
& monitor. encode ( ) ,
286
286
) {
287
287
Ok ( ( ) ) => chain:: ChannelMonitorUpdateStatus :: Completed ,
0 commit comments