edition = "2018"
[dependencies]
-bitcoin = "0.28.1"
-lightning = { version = "0.0.110" }
-lightning-block-sync = { version = "0.0.110", features=["rest-client"] }
-lightning-net-tokio = { version = "0.0.110" }
+bitcoin = "0.29"
+lightning = { version = "0.0.111" }
+lightning-block-sync = { version = "0.0.111", features=["rest-client"] }
+lightning-net-tokio = { version = "0.0.111" }
tokio = { version = "1.14.1", features = ["full"] }
tokio-postgres = { version="0.7.5" }
futures = "0.3"
use std::sync::{Arc, RwLock};
use bitcoin::secp256k1::PublicKey;
+use lightning::ln::features::{InitFeatures, NodeFeatures};
use lightning::ln::msgs::{ChannelAnnouncement, ChannelUpdate, Init, LightningError, NodeAnnouncement, QueryChannelRange, QueryShortChannelIds, ReplyChannelRange, ReplyShortChannelIdsEnd, RoutingMessageHandler};
use lightning::routing::gossip::{NetworkGraph, P2PGossipSync};
use lightning::util::events::{MessageSendEvent, MessageSendEventsProvider};
Ok(output_value)
}
- fn get_next_channel_announcements(&self, starting_point: u64, batch_amount: u8) -> Vec<(ChannelAnnouncement, Option<ChannelUpdate>, Option<ChannelUpdate>)> {
- self.native_router.get_next_channel_announcements(starting_point, batch_amount)
+ fn get_next_channel_announcement(&self, starting_point: u64) -> Option<(ChannelAnnouncement, Option<ChannelUpdate>, Option<ChannelUpdate>)> {
+ self.native_router.get_next_channel_announcement(starting_point)
}
- fn get_next_node_announcements(&self, starting_point: Option<&PublicKey>, batch_amount: u8) -> Vec<NodeAnnouncement> {
- self.native_router.get_next_node_announcements(starting_point, batch_amount)
+ fn get_next_node_announcement(&self, starting_point: Option<&PublicKey>) -> Option<NodeAnnouncement> {
+ self.native_router.get_next_node_announcement(starting_point)
}
fn peer_connected(&self, their_node_id: &PublicKey, init: &Init) {
fn handle_query_short_channel_ids(&self, their_node_id: &PublicKey, msg: QueryShortChannelIds) -> Result<(), LightningError> {
self.native_router.handle_query_short_channel_ids(their_node_id, msg)
}
+
+ fn provided_init_features(&self, their_node_id: &PublicKey) -> InitFeatures {
+ self.native_router.provided_init_features(their_node_id)
+ }
+
+ fn provided_node_features(&self) -> NodeFeatures {
+ self.native_router.provided_node_features()
+ }
}
use std::collections::HashMap;
use bitcoin::BlockHash;
+use bitcoin::hashes::Hash;
use lightning::ln::msgs::{UnsignedChannelAnnouncement, UnsignedChannelUpdate};
use lightning::util::ser::{BigSize, Writeable};
announcements: vec![],
updates: vec![],
full_update_defaults: Default::default(),
- chain_hash: Default::default(),
+ chain_hash: BlockHash::all_zeros(),
latest_seen: 0,
};
let message_handler = MessageHandler {
chan_handler: ErroringMessageHandler::new(),
route_handler: Arc::clone(&router),
+ onion_message_handler: IgnoringMessageHandler {},
};
let peer_handler = Arc::new(PeerManager::new(
message_handler,
our_node_secret,
+ 0xdeadbeef,
&random_data,
TestLogger::new(),
IgnoringMessageHandler {},
use crate::verifier::ChainVerifier;
pub(crate) type GossipChainAccess = Arc<ChainVerifier>;
-pub(crate) type GossipPeerManager = Arc<PeerManager<lightning_net_tokio::SocketDescriptor, ErroringMessageHandler, Arc<GossipRouter>, TestLogger, IgnoringMessageHandler>>;
+pub(crate) type GossipPeerManager = Arc<PeerManager<lightning_net_tokio::SocketDescriptor, ErroringMessageHandler, Arc<GossipRouter>, IgnoringMessageHandler, TestLogger, IgnoringMessageHandler>>;
#[derive(Debug)]
pub(crate) enum GossipMessage {