You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lightning-background-processor/src/lib.rs
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -343,7 +343,7 @@ mod tests {
343
343
use bitcoin::network::constants::Network;
344
344
use lightning::chain::{BestBlock,Confirm, chainmonitor};
345
345
use lightning::chain::channelmonitor::ANTI_REORG_DELAY;
346
-
use lightning::chain::keysinterface::{InMemorySigner,KeysInterface,KeysManager};
346
+
use lightning::chain::keysinterface::{InMemorySigner,Recipient,KeysInterface,KeysManager};
347
347
use lightning::chain::transaction::OutPoint;
348
348
use lightning::get_event_msg;
349
349
use lightning::ln::channelmanager::{BREAKDOWN_TIMEOUT,ChainParameters,ChannelManager,SimpleArcChannelManager};
@@ -426,7 +426,7 @@ mod tests {
426
426
let network_graph = Arc::new(NetworkGraph::new(genesis_block.header.block_hash()));
427
427
let net_graph_msg_handler = Some(Arc::new(NetGraphMsgHandler::new(network_graph.clone(),Some(chain_source.clone()), logger.clone())));
428
428
let msg_handler = MessageHandler{chan_handler:Arc::new(test_utils::TestChannelMessageHandler::new()),route_handler:Arc::new(test_utils::TestRoutingMessageHandler::new())};
429
-
let peer_manager = Arc::new(PeerManager::new(msg_handler, keys_manager.get_node_secret(),&seed, logger.clone(),IgnoringMessageHandler{}));
429
+
let peer_manager = Arc::new(PeerManager::new(msg_handler, keys_manager.get_node_secret(Recipient::Node).unwrap(),&seed, logger.clone(),IgnoringMessageHandler{}));
Copy file name to clipboardExpand all lines: lightning-invoice/src/utils.rs
+219-5Lines changed: 219 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,9 @@ use bitcoin_hashes::Hash;
8
8
usecrate::prelude::*;
9
9
use lightning::chain;
10
10
use lightning::chain::chaininterface::{BroadcasterInterface,FeeEstimator};
11
-
use lightning::chain::keysinterface::{Sign,KeysInterface};
11
+
use lightning::chain::keysinterface::{Recipient,KeysInterface,Sign};
12
12
use lightning::ln::{PaymentHash,PaymentPreimage,PaymentSecret};
13
-
use lightning::ln::channelmanager::{ChannelDetails,ChannelManager,PaymentId,PaymentSendFailure,MIN_FINAL_CLTV_EXPIRY};
13
+
use lightning::ln::channelmanager::{ChannelDetails,ChannelManager,PaymentId,PaymentSendFailure,PhantomRouteHints,MIN_FINAL_CLTV_EXPIRY,MIN_CLTV_EXPIRY_DELTA};
14
14
use lightning::ln::msgs::LightningError;
15
15
use lightning::routing::scoring::Score;
16
16
use lightning::routing::network_graph::{NetworkGraph,RoutingFees};
@@ -21,6 +21,99 @@ use core::convert::TryInto;
21
21
use core::ops::Deref;
22
22
use core::time::Duration;
23
23
24
+
#[cfg(feature = "std")]
25
+
/// Utility to create an invoice that can be paid to one of multiple nodes, or a "phantom invoice."
26
+
/// See [`PhantomKeysManager`] for more information on phantom node payments.
27
+
///
28
+
/// `phantom_route_hints` parameter:
29
+
/// * Contains channel info for all nodes participating in the phantom invoice
30
+
/// * Entries are retrieved from a call to [`ChannelManager::get_phantom_route_hints`] on each
31
+
/// participating node
32
+
/// * It is fine to cache `phantom_route_hints` and reuse it across invoices, as long as the data is
33
+
/// updated when a channel becomes disabled or closes
34
+
/// * Note that if too many channels are included in [`PhantomRouteHints::channels`], the invoice
35
+
/// may be too long for QR code scanning. To fix this, `PhantomRouteHints::channels` may be pared
36
+
/// down
37
+
///
38
+
/// `payment_hash` and `payment_secret` come from [`ChannelManager::create_inbound_payment`] or
39
+
/// [`ChannelManager::create_inbound_payment_for_hash`]. These values can be retrieved from any
40
+
/// participating node.
41
+
///
42
+
/// Note that the provided `keys_manager`'s `KeysInterface` implementation must support phantom
43
+
/// invoices in its `sign_invoice` implementation ([`PhantomKeysManager`] satisfies this
0 commit comments