@@ -583,8 +583,8 @@ pub fn write_rgb_payment_info_file(
583583 . expect ( "able to write rgb payment info pending" ) ;
584584}
585585
586- /// Rename RGB channel info from temporary to final channel ID in KVStore
587- pub ( crate ) fn rename_rgb_files (
586+ /// update RGB data from temporary to final channel ID in KVStore
587+ pub ( crate ) fn update_rgb_channel_id (
588588 channel_id : & ChannelId , temporary_channel_id : & ChannelId , kv_store : & dyn KVStoreSync ,
589589) {
590590 let temp_chan_id = temporary_channel_id. 0 . as_hex ( ) . to_string ( ) ;
@@ -734,7 +734,7 @@ pub trait RgbKvStoreExt {
734734 /// filter first hops to only include channels with sufficient RGB assets
735735 fn filter_first_hops (
736736 & self , payment_hash : & PaymentHash , first_hops : & mut Vec < ChannelDetails > ,
737- ) ;
737+ ) -> ( ContractId , u64 ) ;
738738}
739739
740740impl < K : KVStoreSync + ?Sized > RgbKvStoreExt for K {
@@ -806,11 +806,11 @@ impl<K: KVStoreSync + ?Sized> RgbKvStoreExt for K {
806806 || self . read_rgb_payment_info ( payment_hash, true ) . is_ok ( )
807807 }
808808
809- fn filter_first_hops ( & self , payment_hash : & PaymentHash , first_hops : & mut Vec < ChannelDetails > ) {
810- let rgb_payment_info = match self . read_rgb_payment_info ( payment_hash, false ) {
811- Ok ( info ) => info ,
812- Err ( _ ) => return ,
813- } ;
809+ fn filter_first_hops (
810+ & self , payment_hash : & PaymentHash , first_hops : & mut Vec < ChannelDetails > ,
811+ ) -> ( ContractId , u64 ) {
812+ let rgb_payment_info = self . read_rgb_payment_info ( payment_hash , false )
813+ . expect ( "payment info must exist" ) ;
814814 let contract_id = rgb_payment_info. contract_id ;
815815 let rgb_amount = rgb_payment_info. amount ;
816816 first_hops. retain ( |h| {
@@ -822,5 +822,6 @@ impl<K: KVStoreSync + ?Sized> RgbKvStoreExt for K {
822822 Err ( _) => false ,
823823 }
824824 } ) ;
825+ ( contract_id, rgb_amount)
825826 }
826827}
0 commit comments