@@ -1704,20 +1704,21 @@ impl Node {
17041704
17051705 /// Alby: Return encoded channel monitors for a recovery of last resort
17061706 pub fn get_encoded_channel_monitors ( & self ) -> Result < Vec < KeyValue > , Error > {
1707- let channel_monitor_store = Arc :: clone ( & self . kv_store ) ;
1707+ let channel_monitor_store: & dyn KVStoreSync = & * self . kv_store ;
17081708 let channel_monitor_logger = Arc :: clone ( & self . logger ) ;
1709- let keys = channel_monitor_store . list ( "monitors" , "" ) . map_err ( |e| {
1709+ let keys = KVStoreSync :: list ( channel_monitor_store , "monitors" , "" ) . map_err ( |e| {
17101710 log_error ! ( channel_monitor_logger, "Failed to get monitor keys: {}" , e) ;
17111711 Error :: ConnectionFailed
17121712 } ) ?;
17131713
17141714 let mut entries = Vec :: new ( ) ;
17151715
17161716 for key in keys {
1717- let value = channel_monitor_store. read ( "monitors" , "" , & key) . map_err ( |e| {
1718- log_error ! ( channel_monitor_logger, "Failed to get monitor value: {}" , e) ;
1719- Error :: ConnectionFailed
1720- } ) ?;
1717+ let value =
1718+ KVStoreSync :: read ( channel_monitor_store, "monitors" , "" , & key) . map_err ( |e| {
1719+ log_error ! ( channel_monitor_logger, "Failed to get monitor value: {}" , e) ;
1720+ Error :: ConnectionFailed
1721+ } ) ?;
17211722 entries. push ( KeyValue { key, value } )
17221723 }
17231724
@@ -1739,12 +1740,13 @@ impl Node {
17391740
17401741 let mut total_lightning_balance_sats = 0 ;
17411742 let mut lightning_balances = Vec :: new ( ) ;
1742- for channel_id in self . chain_monitor . list_monitors ( ) {
1743+ for ( channel_id) in self . chain_monitor . list_monitors ( ) {
17431744 match self . chain_monitor . get_monitor ( channel_id) {
17441745 Ok ( monitor) => {
17451746 funding_txo_by_channel_id. insert ( channel_id, funding_txo) ;
17461747
17471748 let counterparty_node_id = monitor. get_counterparty_node_id ( ) ;
1749+ let funding_txo = monitor. get_funding_txo ( ) ;
17481750 for ldk_balance in monitor. get_claimable_balances ( ) {
17491751 total_lightning_balance_sats += ldk_balance. claimable_amount_satoshis ( ) ;
17501752 lightning_balances. push ( LightningBalance :: from_ldk_balance (
@@ -1770,9 +1772,9 @@ impl Node {
17701772 // by LDK for a while (4032 blocks since balances become empty), so we can still try to access it.
17711773 // See [`periodically_archive_fully_resolved_monitors`] for details.
17721774 let funding_txo =
1773- out. channel_id . and_then ( |c| funding_txo_by_channel_id. get ( & c) ) . cloned ( ) ;
1775+ out. channel_id . and_then ( |c| funding_txo_by_channel_id. get ( & c) . cloned ( ) ) ;
17741776 let chmon = funding_txo. and_then ( |txo| self . chain_monitor . get_monitor ( txo) . ok ( ) ) ;
1775- let counterparty_node_id = chmon. and_then ( |m| m. get_counterparty_node_id ( ) ) ;
1777+ let counterparty_node_id = chmon. and_then ( |m| Some ( m. get_counterparty_node_id ( ) ) ) ;
17761778 PendingSweepBalance :: from_tracked_spendable_output (
17771779 out,
17781780 counterparty_node_id,
0 commit comments