Skip to content

Commit

Permalink
f Account for OnionMessenger now taking MR and OMH
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed Jun 24, 2023
1 parent 2c125b7 commit 19dc993
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use crate::logger::{log_error, FilesystemLogger, Logger};
use crate::payment_store::PaymentStore;
use crate::peer_store::PeerStore;
use crate::types::{
ChainMonitor, ChannelManager, GossipSync, KeysManager, NetAddress, NetworkGraph,
OnionMessenger, PeerManager,
ChainMonitor, ChannelManager, FakeMessageRouter, GossipSync, KeysManager, NetAddress,
NetworkGraph, OnionMessenger, PeerManager,
};
use crate::wallet::Wallet;
use crate::LogLevel;
Expand All @@ -18,7 +18,6 @@ use crate::{
WALLET_KEYS_SEED_LEN,
};

use lightning::sign::EntropySource;
use lightning::chain::{chainmonitor, BestBlock, Watch};
use lightning::ln::channelmanager::{self, ChainParameters, ChannelManagerReadArgs};
use lightning::ln::msgs::RoutingMessageHandler;
Expand All @@ -27,6 +26,7 @@ use lightning::routing::router::DefaultRouter;
use lightning::routing::scoring::{
ProbabilisticScorer, ProbabilisticScoringDecayParameters, ProbabilisticScoringFeeParameters,
};
use lightning::sign::EntropySource;

use lightning::util::config::UserConfig;
use lightning::util::ser::ReadableArgs;
Expand Down Expand Up @@ -604,6 +604,8 @@ fn build_with_store_internal<K: KVStore + Sync + Send + 'static>(
Arc::clone(&keys_manager),
Arc::clone(&keys_manager),
Arc::clone(&logger),
Arc::new(FakeMessageRouter {}),
IgnoringMessageHandler {},
IgnoringMessageHandler {},
));
let ephemeral_bytes: [u8; 32] = keys_manager.get_secure_random_bytes();
Expand Down
13 changes: 13 additions & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,22 @@ pub(crate) type OnionMessenger = lightning::onion_message::OnionMessenger<
Arc<WalletKeysManager<bdk::database::SqliteDatabase, Arc<FilesystemLogger>>>,
Arc<WalletKeysManager<bdk::database::SqliteDatabase, Arc<FilesystemLogger>>>,
Arc<FilesystemLogger>,
Arc<FakeMessageRouter>,
IgnoringMessageHandler,
IgnoringMessageHandler,
>;

pub(crate) struct FakeMessageRouter {}

impl lightning::onion_message::MessageRouter for FakeMessageRouter {
fn find_path(
&self, _sender: PublicKey, _peers: Vec<PublicKey>,
_destination: lightning::onion_message::Destination,
) -> Result<lightning::onion_message::OnionMessagePath, ()> {
unimplemented!()
}
}

/// The global identifier of a channel.
///
/// Note that this will start out to be a temporary ID until channel funding negotiation is
Expand Down

0 comments on commit 19dc993

Please sign in to comment.