Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lightning/src/ln/outbound_payment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use crate::offers::invoice_request::InvoiceRequest;
use crate::offers::nonce::Nonce;
use crate::offers::static_invoice::StaticInvoice;
use crate::rgb_utils::{
filter_first_hops, get_rgb_payment_info_path, is_payment_rgb, parse_rgb_payment_info,
filter_first_hops, get_rgb_payment_info_path, is_payment_rgb_out, parse_rgb_payment_info,
};
use crate::routing::router::{
BlindedTail, InFlightHtlcs, Path, PaymentParameters, Route, RouteParameters,
Expand Down Expand Up @@ -1049,7 +1049,7 @@ impl OutboundPayments {
}

let mut filtered_first_hops = first_hops.into_iter().collect::<Vec<_>>();
let rgb_payment = is_payment_rgb(&self.ldk_data_dir, &payment_hash).then(|| {
let rgb_payment = is_payment_rgb_out(&self.ldk_data_dir, &payment_hash).then(|| {
filter_first_hops(&self.ldk_data_dir, &payment_hash, &mut filtered_first_hops)
});
let mut route_params = RouteParameters::from_payment_params_and_value(
Expand Down Expand Up @@ -1569,7 +1569,7 @@ impl OutboundPayments {
SP: Fn(SendAlongPathArgs) -> Result<(), APIError>,
{
let mut filtered_first_hops = first_hops.into_iter().collect::<Vec<_>>();
is_payment_rgb(&self.ldk_data_dir, &payment_hash).then(|| {
is_payment_rgb_out(&self.ldk_data_dir, &payment_hash).then(|| {
filter_first_hops(&self.ldk_data_dir, &payment_hash, &mut filtered_first_hops)
});
let route = self.find_initial_route(
Expand Down Expand Up @@ -1626,7 +1626,7 @@ impl OutboundPayments {
}

let mut filtered_first_hops = first_hops.into_iter().collect::<Vec<_>>();
is_payment_rgb(&self.ldk_data_dir, &payment_hash).then(|| {
is_payment_rgb_out(&self.ldk_data_dir, &payment_hash).then(|| {
filter_first_hops(&self.ldk_data_dir, &payment_hash, &mut filtered_first_hops)
});

Expand Down
5 changes: 2 additions & 3 deletions lightning/src/rgb_utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,10 +742,9 @@ pub(crate) fn update_rgb_channel_amount_pending(
)
}

/// Whether the payment is colored
pub(crate) fn is_payment_rgb(ldk_data_dir: &Path, payment_hash: &PaymentHash) -> bool {
/// Whether the outbound payment is colored.
pub(crate) fn is_payment_rgb_out(ldk_data_dir: &Path, payment_hash: &PaymentHash) -> bool {
get_rgb_payment_info_path(payment_hash, ldk_data_dir, false).exists()
|| get_rgb_payment_info_path(payment_hash, ldk_data_dir, true).exists()
}

/// Detect the contract ID of the payment and then filter hops based on contract ID and amount
Expand Down
Loading