Skip to content

Commit 7dd6b44

Browse files
committed
Move create_blinded_path_using_absolute_expiry to flow.rs
1 parent 97af1df commit 7dd6b44

File tree

7 files changed

+226
-182
lines changed

7 files changed

+226
-182
lines changed

lightning-background-processor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
647647
/// # type NetworkGraph = lightning::routing::gossip::NetworkGraph<Arc<Logger>>;
648648
/// # type P2PGossipSync<UL> = lightning::routing::gossip::P2PGossipSync<Arc<NetworkGraph>, Arc<UL>, Arc<Logger>>;
649649
/// # type ChannelManager<B, F, FE> = lightning::ln::channelmanager::SimpleArcChannelManager<ChainMonitor<B, F, FE>, B, FE, Logger>;
650-
/// # type OffersMessageFlow<B, F, FE> = lightning::offers::flow::OffersMessageFlow<Arc<lightning::sign::KeysManager>, Arc<ChannelManager<B, F, FE>>, Arc<Logger>>;
650+
/// # type OffersMessageFlow<B, F, FE> = lightning::offers::flow::OffersMessageFlow<Arc<lightning::sign::KeysManager>, Arc<ChannelManager<B, F, FE>>, Arc<lightning::onion_message::messenger::DefaultMessageRouter<Arc<NetworkGraph>, Arc<Logger>, Arc<lightning::sign::KeysManager>>>, Arc<Logger>>;
651651
/// # type OnionMessenger<B, F, FE> = lightning::onion_message::messenger::OnionMessenger<Arc<lightning::sign::KeysManager>, Arc<lightning::sign::KeysManager>, Arc<Logger>, Arc<ChannelManager<B, F, FE>>, Arc<lightning::onion_message::messenger::DefaultMessageRouter<Arc<NetworkGraph>, Arc<Logger>, Arc<lightning::sign::KeysManager>>>, Arc<OffersMessageFlow<B, F, FE>>, lightning::ln::peer_handler::IgnoringMessageHandler, lightning::ln::peer_handler::IgnoringMessageHandler, lightning::ln::peer_handler::IgnoringMessageHandler>;
652652
/// # type Scorer = RwLock<lightning::routing::scoring::ProbabilisticScorer<Arc<NetworkGraph>, Arc<Logger>>>;
653653
/// # type PeerManager<B, F, FE, UL> = lightning::ln::peer_handler::SimpleArcPeerManager<SocketDescriptor, ChainMonitor<B, F, FE>, B, FE, Arc<UL>, Logger>;

lightning/src/ln/blinded_payment_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ fn blinded_keysend() {
12251225
&nodes[2].keys_manager.get_inbound_payment_key_material()
12261226
);
12271227
let payment_secret = inbound_payment::create_for_spontaneous_payment(
1228-
&inbound_payment_key, None, u32::MAX, nodes[2].node.duration_since_epoch().as_secs(), None
1228+
&inbound_payment_key, None, u32::MAX, nodes[2].offers_handler.duration_since_epoch().as_secs(), None
12291229
).unwrap();
12301230

12311231
let amt_msat = 5000;
@@ -1266,7 +1266,7 @@ fn blinded_mpp_keysend() {
12661266
&nodes[3].keys_manager.get_inbound_payment_key_material()
12671267
);
12681268
let payment_secret = inbound_payment::create_for_spontaneous_payment(
1269-
&inbound_payment_key, None, u32::MAX, nodes[3].node.duration_since_epoch().as_secs(), None
1269+
&inbound_payment_key, None, u32::MAX, nodes[3].offers_handler.duration_since_epoch().as_secs(), None
12701270
).unwrap();
12711271

12721272
let amt_msat = 15_000_000;

lightning/src/ln/channelmanager.rs

Lines changed: 25 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ use bitcoin::secp256k1::Secp256k1;
3333
use bitcoin::{secp256k1, Sequence, Weight};
3434

3535
use crate::events::FundingInfo;
36-
use crate::blinded_path::message::{AsyncPaymentsContext, MessageContext, OffersContext};
36+
use crate::blinded_path::message::{AsyncPaymentsContext, MessageContext, MessageForwardNode, OffersContext};
3737
use crate::blinded_path::NodeIdLookUp;
38-
use crate::blinded_path::message::{BlindedMessagePath, MessageForwardNode};
38+
use crate::blinded_path::message::BlindedMessagePath;
3939
use crate::blinded_path::payment::{BlindedPaymentPath, PaymentConstraints, PaymentContext, ReceiveTlvs};
4040
use crate::chain;
4141
use crate::chain::{Confirm, ChannelMonitorUpdateStatus, Watch, BestBlock};
@@ -47,7 +47,6 @@ use crate::events::{self, Event, EventHandler, EventsProvider, InboundChannelFun
4747
// construct one themselves.
4848
use crate::ln::inbound_payment;
4949
use crate::ln::types::ChannelId;
50-
use crate::offers::offer::Offer;
5150
use crate::offers::flow::OffersMessageCommons;
5251
use crate::types::payment::{PaymentHash, PaymentPreimage, PaymentSecret};
5352
use crate::ln::channel::{self, Channel, ChannelPhase, ChannelError, ChannelUpdateStatus, ShutdownResult, UpdateFulfillCommitFetch, OutboundV1Channel, InboundV1Channel, WithChannelContext, InboundV2Channel, InteractivelyFunded as _};
@@ -66,14 +65,13 @@ use crate::ln::outbound_payment;
6665
use crate::ln::outbound_payment::{OutboundPayments, PendingOutboundPayment, RetryableInvoiceRequest, SendAlongPathArgs, StaleExpiration};
6766
use crate::offers::invoice::Bolt12Invoice;
6867
use crate::offers::invoice::UnsignedBolt12Invoice;
69-
use crate::offers::invoice_request::{InvoiceRequest, InvoiceRequestBuilder};
68+
use crate::offers::invoice_request::InvoiceRequest;
7069
use crate::offers::nonce::Nonce;
7170
use crate::offers::parse::Bolt12SemanticError;
7271
use crate::offers::signer;
7372
#[cfg(async_payments)]
7473
use crate::offers::static_invoice::StaticInvoice;
7574
use crate::onion_message::async_payments::{AsyncPaymentsMessage, HeldHtlcAvailable, ReleaseHeldHtlc, AsyncPaymentsMessageHandler};
76-
use crate::onion_message::dns_resolution::HumanReadableName;
7775
use crate::onion_message::messenger::{DefaultMessageRouter, Destination, MessageRouter, MessageSendInstructions, Responder, ResponseInstruction};
7876
use crate::onion_message::offers::OffersMessage;
7977
use crate::sign::{EntropySource, NodeSigner, Recipient, SignerProvider};
@@ -2585,26 +2583,6 @@ const MAX_UNFUNDED_CHANNEL_PEERS: usize = 50;
25852583
/// many peers we reject new (inbound) connections.
25862584
const MAX_NO_CHANNEL_PEERS: usize = 250;
25872585

2588-
/// The maximum expiration from the current time where an [`Offer`] or [`Refund`] is considered
2589-
/// short-lived, while anything with a greater expiration is considered long-lived.
2590-
///
2591-
/// Using [`OffersMessageFlow::create_offer_builder`] or [`OffersMessageFlow::create_refund_builder`],
2592-
/// will included a [`BlindedMessagePath`] created using:
2593-
/// - [`MessageRouter::create_compact_blinded_paths`] when short-lived, and
2594-
/// - [`MessageRouter::create_blinded_paths`] when long-lived.
2595-
///
2596-
/// [`OffersMessageFlow::create_offer_builder`]: crate::offers::flow::OffersMessageFlow::create_offer_builder
2597-
/// [`OffersMessageFlow::create_refund_builder`]: crate::offers::flow::OffersMessageFlow::create_refund_builder
2598-
///
2599-
///
2600-
/// Using compact [`BlindedMessagePath`]s may provide better privacy as the [`MessageRouter`] could select
2601-
/// more hops. However, since they use short channel ids instead of pubkeys, they are more likely to
2602-
/// become invalid over time as channels are closed. Thus, they are only suitable for short-term use.
2603-
///
2604-
/// [`Offer`]: crate::offers::offer
2605-
/// [`Refund`]: crate::offers::refund
2606-
pub const MAX_SHORT_LIVED_RELATIVE_EXPIRY: Duration = Duration::from_secs(60 * 60 * 24);
2607-
26082586
/// Used by [`ChannelManager::list_recent_payments`] to express the status of recent payments.
26092587
/// These include payments that have yet to find a successful path, or have unresolved HTLCs.
26102588
#[derive(Debug, PartialEq)]
@@ -9495,6 +9473,23 @@ where
94959473
)
94969474
}
94979475

9476+
fn get_peer_for_blinded_path(&self) -> Vec<MessageForwardNode> {
9477+
self.per_peer_state.read().unwrap()
9478+
.iter()
9479+
.map(|(node_id, peer_state)| (node_id, peer_state.lock().unwrap()))
9480+
.filter(|(_, peer)| peer.is_connected)
9481+
.filter(|(_, peer)| peer.latest_features.supports_onion_messages())
9482+
.map(|(node_id, peer)| MessageForwardNode {
9483+
node_id: *node_id,
9484+
short_channel_id: peer.channel_by_id
9485+
.iter()
9486+
.filter(|(_, channel)| channel.context().is_usable())
9487+
.min_by_key(|(_, channel)| channel.context().channel_creation_height)
9488+
.and_then(|(_, channel)| channel.context().get_short_channel_id()),
9489+
})
9490+
.collect::<Vec<_>>()
9491+
}
9492+
94989493
fn verify_bolt12_invoice(
94999494
&self, invoice: &Bolt12Invoice, context: Option<&OffersContext>,
95009495
) -> Result<PaymentId, ()> {
@@ -9651,19 +9646,6 @@ where
96519646
res
96529647
}
96539648

9654-
fn create_blinded_paths_using_absolute_expiry(
9655-
&self, context: OffersContext, absolute_expiry: Option<Duration>,
9656-
) -> Result<Vec<BlindedMessagePath>, ()> {
9657-
let now = self.duration_since_epoch();
9658-
let max_short_lived_absolute_expiry = now.saturating_add(MAX_SHORT_LIVED_RELATIVE_EXPIRY);
9659-
9660-
if absolute_expiry.unwrap_or(Duration::MAX) <= max_short_lived_absolute_expiry {
9661-
self.create_compact_blinded_paths(context)
9662-
} else {
9663-
self.create_blinded_paths(MessageContext::Offers(context))
9664-
}
9665-
}
9666-
96679649
fn get_chain_hash(&self) -> ChainHash {
96689650
self.chain_hash
96699651
}
@@ -9682,53 +9664,6 @@ where
96829664
self.pending_outbound_payments.add_new_awaiting_offer(payment_id, expiration, retry_strategy, max_total_routing_fee_msat, amount_msats)
96839665
}
96849666

9685-
fn pay_for_offer_intern<CPP: FnOnce(&InvoiceRequest, Nonce) -> Result<(), Bolt12SemanticError>>(
9686-
&self, offer: &Offer, quantity: Option<u64>, amount_msats: Option<u64>,
9687-
payer_note: Option<String>, payment_id: PaymentId,
9688-
human_readable_name: Option<HumanReadableName>, create_pending_payment: CPP,
9689-
) -> Result<(), Bolt12SemanticError> {
9690-
let expanded_key = &self.inbound_payment_key;
9691-
let entropy = &*self.entropy_source;
9692-
let secp_ctx = &self.secp_ctx;
9693-
9694-
let nonce = Nonce::from_entropy_source(entropy);
9695-
let builder: InvoiceRequestBuilder<secp256k1::All> = offer
9696-
.request_invoice(expanded_key, nonce, secp_ctx, payment_id)?
9697-
.into();
9698-
let builder = builder.chain_hash(self.chain_hash)?;
9699-
9700-
let builder = match quantity {
9701-
None => builder,
9702-
Some(quantity) => builder.quantity(quantity)?,
9703-
};
9704-
let builder = match amount_msats {
9705-
None => builder,
9706-
Some(amount_msats) => builder.amount_msats(amount_msats)?,
9707-
};
9708-
let builder = match payer_note {
9709-
None => builder,
9710-
Some(payer_note) => builder.payer_note(payer_note),
9711-
};
9712-
let builder = match human_readable_name {
9713-
None => builder,
9714-
Some(hrn) => builder.sourced_from_human_readable_name(hrn),
9715-
};
9716-
let invoice_request = builder.build_and_sign()?;
9717-
9718-
let hmac = payment_id.hmac_for_offer_payment(nonce, expanded_key);
9719-
let context = MessageContext::Offers(
9720-
OffersContext::OutboundPayment { payment_id, nonce, hmac: Some(hmac) }
9721-
);
9722-
let reply_paths = self.create_blinded_paths(context)
9723-
.map_err(|_| Bolt12SemanticError::MissingPaths)?;
9724-
9725-
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
9726-
9727-
create_pending_payment(&invoice_request, nonce)?;
9728-
9729-
self.enqueue_invoice_request(invoice_request, reply_paths)
9730-
}
9731-
97329667
#[cfg(feature = "dnssec")]
97339668
fn amt_msats_for_payment_awaiting_offer(&self, payment_id: PaymentId) -> Result<u64, ()> {
97349669
self.pending_outbound_payments.amt_msats_for_payment_awaiting_offer(payment_id)
@@ -9740,6 +9675,11 @@ where
97409675
) -> Result<(), ()> {
97419676
self.pending_outbound_payments.received_offer(payment_id, retryable_invoice_request)
97429677
}
9678+
9679+
#[cfg(not(feature = "std"))]
9680+
fn get_highest_seen_timestamp(&self) -> Duration {
9681+
Duration::from_secs(self.highest_seen_timestamp.load(Ordering::Acquire) as u64)
9682+
}
97439683
}
97449684

97459685
/// Defines the maximum number of [`OffersMessage`] including different reply paths to be sent
@@ -9822,47 +9762,6 @@ where
98229762
inbound_payment::get_payment_preimage(payment_hash, payment_secret, &self.inbound_payment_key)
98239763
}
98249764

9825-
pub(super) fn duration_since_epoch(&self) -> Duration {
9826-
#[cfg(not(feature = "std"))]
9827-
let now = Duration::from_secs(
9828-
self.highest_seen_timestamp.load(Ordering::Acquire) as u64
9829-
);
9830-
#[cfg(feature = "std")]
9831-
let now = std::time::SystemTime::now()
9832-
.duration_since(std::time::SystemTime::UNIX_EPOCH)
9833-
.expect("SystemTime::now() should come after SystemTime::UNIX_EPOCH");
9834-
9835-
now
9836-
}
9837-
9838-
/// Creates a collection of blinded paths by delegating to
9839-
/// [`MessageRouter::create_compact_blinded_paths`].
9840-
///
9841-
/// Errors if the `MessageRouter` errors.
9842-
fn create_compact_blinded_paths(&self, context: OffersContext) -> Result<Vec<BlindedMessagePath>, ()> {
9843-
let recipient = self.get_our_node_id();
9844-
let secp_ctx = &self.secp_ctx;
9845-
9846-
let peers = self.per_peer_state.read().unwrap()
9847-
.iter()
9848-
.map(|(node_id, peer_state)| (node_id, peer_state.lock().unwrap()))
9849-
.filter(|(_, peer)| peer.is_connected)
9850-
.filter(|(_, peer)| peer.latest_features.supports_onion_messages())
9851-
.map(|(node_id, peer)| MessageForwardNode {
9852-
node_id: *node_id,
9853-
short_channel_id: peer.channel_by_id
9854-
.iter()
9855-
.filter(|(_, channel)| channel.context().is_usable())
9856-
.min_by_key(|(_, channel)| channel.context().channel_creation_height)
9857-
.and_then(|(_, channel)| channel.context().get_short_channel_id()),
9858-
})
9859-
.collect::<Vec<_>>();
9860-
9861-
self.message_router
9862-
.create_compact_blinded_paths(recipient, MessageContext::Offers(context), peers, secp_ctx)
9863-
.and_then(|paths| (!paths.is_empty()).then(|| paths).ok_or(()))
9864-
}
9865-
98669765
/// Gets a fake short channel id for use in receiving [phantom node payments]. These fake scids
98679766
/// are used when constructing the phantom invoice's route hints.
98689767
///

lightning/src/ln/functional_test_utils.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ type TestChannelManager<'node_cfg, 'chan_mon_cfg> = ChannelManager<
415415
pub type TestOffersMessageFlow<'chan_man, 'node_cfg, 'chan_mon_cfg> = OffersMessageFlow<
416416
&'node_cfg test_utils::TestKeysInterface,
417417
&'chan_man TestChannelManager<'node_cfg, 'chan_mon_cfg>,
418+
&'node_cfg test_utils::TestMessageRouter<'chan_mon_cfg>,
418419
&'chan_mon_cfg test_utils::TestLogger,
419420
>;
420421

@@ -1194,7 +1195,7 @@ macro_rules! reload_node {
11941195
$new_channelmanager = _reload_node(&$node, $new_config, &chanman_encoded, $monitors_encoded);
11951196

11961197
let offers_handler = $crate::sync::Arc::new($crate::offers::flow::OffersMessageFlow::new(
1197-
$new_channelmanager.inbound_payment_key, $new_channelmanager.get_our_node_id(), $node.keys_manager, &$new_channelmanager, $node.logger
1198+
$new_channelmanager.inbound_payment_key, $new_channelmanager.get_our_node_id(), $node.keys_manager, &$new_channelmanager, $node.message_router, $node.logger
11981199
));
11991200

12001201
$node.node = &$new_channelmanager;
@@ -3357,7 +3358,7 @@ pub fn create_network<'a, 'b: 'a, 'c: 'b>(node_count: usize, cfgs: &'b Vec<NodeC
33573358
for i in 0..node_count {
33583359
let dedicated_entropy = DedicatedEntropy(RandomBytes::new([i as u8; 32]));
33593360
let offers_handler = Arc::new(OffersMessageFlow::new(
3360-
chan_mgrs[i].inbound_payment_key, chan_mgrs[i].get_our_node_id(), cfgs[i].keys_manager, &chan_mgrs[i], cfgs[i].logger
3361+
chan_mgrs[i].inbound_payment_key, chan_mgrs[i].get_our_node_id(), cfgs[i].keys_manager, &chan_mgrs[i], &cfgs[i].message_router, cfgs[i].logger
33613362
));
33623363
#[cfg(feature = "dnssec")]
33633364
let onion_messenger = OnionMessenger::new(

lightning/src/ln/offers_tests.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,12 @@ use crate::blinded_path::message::BlindedMessagePath;
4848
use crate::blinded_path::payment::{Bolt12OfferContext, Bolt12RefundContext, PaymentContext};
4949
use crate::blinded_path::message::{MessageContext, OffersContext};
5050
use crate::events::{ClosureReason, Event, MessageSendEventsProvider, PaymentFailureReason, PaymentPurpose};
51-
use crate::ln::channelmanager::{MAX_SHORT_LIVED_RELATIVE_EXPIRY, PaymentId, RecentPaymentDetails, Retry, self};
51+
use crate::ln::channelmanager::{PaymentId, RecentPaymentDetails, Retry, self};
5252
use crate::types::features::Bolt12InvoiceFeatures;
5353
use crate::ln::functional_test_utils::*;
5454
use crate::ln::inbound_payment::ExpandedKey;
5555
use crate::ln::msgs::{ChannelMessageHandler, Init, NodeAnnouncement, OnionMessage, OnionMessageHandler, RoutingMessageHandler, SocketAddress, UnsignedGossipMessage, UnsignedNodeAnnouncement};
56+
use crate::offers::flow::MAX_SHORT_LIVED_RELATIVE_EXPIRY;
5657
use crate::offers::invoice::Bolt12Invoice;
5758
use crate::offers::invoice_error::InvoiceError;
5859
use crate::offers::invoice_request::{InvoiceRequest, InvoiceRequestFields};
@@ -388,7 +389,7 @@ fn creates_short_lived_offer() {
388389
let alice_id = alice.node.get_our_node_id();
389390
let bob = &nodes[1];
390391

391-
let absolute_expiry = alice.node.duration_since_epoch() + MAX_SHORT_LIVED_RELATIVE_EXPIRY;
392+
let absolute_expiry = alice.offers_handler.duration_since_epoch() + MAX_SHORT_LIVED_RELATIVE_EXPIRY;
392393
let offer = alice.offers_handler
393394
.create_offer_builder(Some(absolute_expiry)).unwrap()
394395
.build().unwrap();
@@ -414,7 +415,7 @@ fn creates_long_lived_offer() {
414415
let alice = &nodes[0];
415416
let alice_id = alice.node.get_our_node_id();
416417

417-
let absolute_expiry = alice.node.duration_since_epoch() + MAX_SHORT_LIVED_RELATIVE_EXPIRY
418+
let absolute_expiry = alice.offers_handler.duration_since_epoch() + MAX_SHORT_LIVED_RELATIVE_EXPIRY
418419
+ Duration::from_secs(1);
419420
let offer = alice.offers_handler
420421
.create_offer_builder(Some(absolute_expiry))
@@ -450,7 +451,7 @@ fn creates_short_lived_refund() {
450451
let bob = &nodes[1];
451452
let bob_id = bob.node.get_our_node_id();
452453

453-
let absolute_expiry = bob.node.duration_since_epoch() + MAX_SHORT_LIVED_RELATIVE_EXPIRY;
454+
let absolute_expiry = bob.offers_handler.duration_since_epoch() + MAX_SHORT_LIVED_RELATIVE_EXPIRY;
454455
let payment_id = PaymentId([1; 32]);
455456
let refund = bob.offers_handler
456457
.create_refund_builder(10_000_000, absolute_expiry, payment_id, Retry::Attempts(0), None)
@@ -478,7 +479,7 @@ fn creates_long_lived_refund() {
478479
let bob = &nodes[1];
479480
let bob_id = bob.node.get_our_node_id();
480481

481-
let absolute_expiry = bob.node.duration_since_epoch() + MAX_SHORT_LIVED_RELATIVE_EXPIRY
482+
let absolute_expiry = bob.offers_handler.duration_since_epoch() + MAX_SHORT_LIVED_RELATIVE_EXPIRY
482483
+ Duration::from_secs(1);
483484
let payment_id = PaymentId([1; 32]);
484485
let refund = bob.offers_handler
@@ -1607,7 +1608,7 @@ fn fails_creating_or_paying_for_offer_without_connected_peers() {
16071608
disconnect_peers(alice, &[bob, charlie, david, &nodes[4], &nodes[5]]);
16081609
disconnect_peers(david, &[bob, charlie, &nodes[4], &nodes[5]]);
16091610

1610-
let absolute_expiry = alice.node.duration_since_epoch() + MAX_SHORT_LIVED_RELATIVE_EXPIRY;
1611+
let absolute_expiry = alice.offers_handler.duration_since_epoch() + MAX_SHORT_LIVED_RELATIVE_EXPIRY;
16111612
match alice.offers_handler.create_offer_builder(Some(absolute_expiry)) {
16121613
Ok(_) => panic!("Expected error"),
16131614
Err(e) => assert_eq!(e, Bolt12SemanticError::MissingPaths),
@@ -1678,7 +1679,7 @@ fn fails_creating_refund_or_sending_invoice_without_connected_peers() {
16781679
disconnect_peers(alice, &[bob, charlie, david, &nodes[4], &nodes[5]]);
16791680
disconnect_peers(david, &[bob, charlie, &nodes[4], &nodes[5]]);
16801681

1681-
let absolute_expiry = david.node.duration_since_epoch() + MAX_SHORT_LIVED_RELATIVE_EXPIRY;
1682+
let absolute_expiry = david.offers_handler.duration_since_epoch() + MAX_SHORT_LIVED_RELATIVE_EXPIRY;
16821683
let payment_id = PaymentId([1; 32]);
16831684
match david.offers_handler.create_refund_builder(
16841685
10_000_000, absolute_expiry, payment_id, Retry::Attempts(0), None
@@ -2144,7 +2145,7 @@ fn fails_paying_invoice_with_unknown_required_features() {
21442145
let expanded_key = ExpandedKey::new(&alice.keys_manager.get_inbound_payment_key_material());
21452146
let secp_ctx = Secp256k1::new();
21462147

2147-
let created_at = alice.node.duration_since_epoch();
2148+
let created_at = alice.offers_handler.duration_since_epoch();
21482149
let invoice = invoice_request
21492150
.verify_using_recipient_data(nonce, &expanded_key, &secp_ctx).unwrap()
21502151
.respond_using_derived_keys_no_std(payment_paths, payment_hash, created_at).unwrap()

0 commit comments

Comments
 (0)