use bitcoin::secp256k1::{PublicKey,SecretKey};
use bitcoin::secp256k1::{Secp256k1, All};
use bitcoin::secp256k1::{PublicKey,SecretKey};
use bitcoin::secp256k1::{Secp256k1, All};
pub(super) fn get_nodes(secp_ctx: &Secp256k1<All>) -> (SecretKey, PublicKey, Vec<SecretKey>, Vec<PublicKey>) {
let privkeys: Vec<SecretKey> = (2..22).map(|i| {
pub(super) fn get_nodes(secp_ctx: &Secp256k1<All>) -> (SecretKey, PublicKey, Vec<SecretKey>, Vec<PublicKey>) {
let privkeys: Vec<SecretKey> = (2..22).map(|i| {
let our_id = PublicKey::from_secret_key(&secp_ctx, &our_privkey);
(our_privkey, our_id, privkeys, pubkeys)
let our_id = PublicKey::from_secret_key(&secp_ctx, &our_privkey);
(our_privkey, our_id, privkeys, pubkeys)
add_channel(&gossip_sync, &secp_ctx, &cur_privkey, &next_privkey,
ChannelFeatures::from_le_bytes(id_to_feature_flags(1)), cur_short_channel_id);
update_channel(&gossip_sync, &secp_ctx, &cur_privkey, UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &cur_privkey, &next_privkey,
ChannelFeatures::from_le_bytes(id_to_feature_flags(1)), cur_short_channel_id);
update_channel(&gossip_sync, &secp_ctx, &cur_privkey, UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &next_privkey, UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &next_privkey, UnsignedChannelUpdate {
short_channel_id: cur_short_channel_id,
timestamp: (idx as u32)+1,
flags: 1,
short_channel_id: cur_short_channel_id,
timestamp: (idx as u32)+1,
flags: 1,
add_channel(&gossip_sync, &secp_ctx, &our_privkey, &privkeys[0], ChannelFeatures::from_le_bytes(id_to_feature_flags(1)), 1);
update_channel(&gossip_sync, &secp_ctx, &privkeys[0], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &our_privkey, &privkeys[0], ChannelFeatures::from_le_bytes(id_to_feature_flags(1)), 1);
update_channel(&gossip_sync, &secp_ctx, &privkeys[0], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &our_privkey, &privkeys[1], ChannelFeatures::from_le_bytes(id_to_feature_flags(2)), 2);
update_channel(&gossip_sync, &secp_ctx, &our_privkey, UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &our_privkey, &privkeys[1], ChannelFeatures::from_le_bytes(id_to_feature_flags(2)), 2);
update_channel(&gossip_sync, &secp_ctx, &our_privkey, UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[1], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[1], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &our_privkey, &privkeys[7], ChannelFeatures::from_le_bytes(id_to_feature_flags(12)), 12);
update_channel(&gossip_sync, &secp_ctx, &our_privkey, UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &our_privkey, &privkeys[7], ChannelFeatures::from_le_bytes(id_to_feature_flags(12)), 12);
update_channel(&gossip_sync, &secp_ctx, &our_privkey, UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[7], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[7], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &privkeys[0], &privkeys[2], ChannelFeatures::from_le_bytes(id_to_feature_flags(3)), 3);
update_channel(&gossip_sync, &secp_ctx, &privkeys[0], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &privkeys[0], &privkeys[2], ChannelFeatures::from_le_bytes(id_to_feature_flags(3)), 3);
update_channel(&gossip_sync, &secp_ctx, &privkeys[0], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &privkeys[1], &privkeys[2], ChannelFeatures::from_le_bytes(id_to_feature_flags(4)), 4);
update_channel(&gossip_sync, &secp_ctx, &privkeys[1], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &privkeys[1], &privkeys[2], ChannelFeatures::from_le_bytes(id_to_feature_flags(4)), 4);
update_channel(&gossip_sync, &secp_ctx, &privkeys[1], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &privkeys[7], &privkeys[2], ChannelFeatures::from_le_bytes(id_to_feature_flags(13)), 13);
update_channel(&gossip_sync, &secp_ctx, &privkeys[7], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &privkeys[7], &privkeys[2], ChannelFeatures::from_le_bytes(id_to_feature_flags(13)), 13);
update_channel(&gossip_sync, &secp_ctx, &privkeys[7], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &privkeys[2], &privkeys[4], ChannelFeatures::from_le_bytes(id_to_feature_flags(6)), 6);
update_channel(&gossip_sync, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &privkeys[2], &privkeys[4], ChannelFeatures::from_le_bytes(id_to_feature_flags(6)), 6);
update_channel(&gossip_sync, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[4], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[4], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &privkeys[4], &privkeys[3], ChannelFeatures::from_le_bytes(id_to_feature_flags(11)), 11);
update_channel(&gossip_sync, &secp_ctx, &privkeys[4], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &privkeys[4], &privkeys[3], ChannelFeatures::from_le_bytes(id_to_feature_flags(11)), 11);
update_channel(&gossip_sync, &secp_ctx, &privkeys[4], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[3], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[3], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &privkeys[2], &privkeys[5], ChannelFeatures::from_le_bytes(id_to_feature_flags(7)), 7);
update_channel(&gossip_sync, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
add_channel(&gossip_sync, &secp_ctx, &privkeys[2], &privkeys[5], ChannelFeatures::from_le_bytes(id_to_feature_flags(7)), 7);
update_channel(&gossip_sync, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[5], UnsignedChannelUpdate {
excess_data: Vec::new()
});
update_channel(&gossip_sync, &secp_ctx, &privkeys[5], UnsignedChannelUpdate {