use bitcoin::hashes::Hash;
use bitcoin::network::constants::Network;
use bitcoin::blockdata::constants::genesis_block;
- use bitcoin::util::hash::BitcoinHash;
use hex;
let unsigned_announcement = UnsignedChannelAnnouncement {
features,
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id,
node_id_1,
node_id_2,
add_channel(&net_graph_msg_handler, &secp_ctx, &our_privkey, &privkeys[0], ChannelFeatures::from_le_bytes(id_to_feature_flags(1)), 1);
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[0], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 1,
timestamp: 1,
flags: 1,
add_channel(&net_graph_msg_handler, &secp_ctx, &our_privkey, &privkeys[1], ChannelFeatures::from_le_bytes(id_to_feature_flags(2)), 2);
update_channel(&net_graph_msg_handler, &secp_ctx, &our_privkey, UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 2,
timestamp: 1,
flags: 0,
excess_data: Vec::new()
});
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[1], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 2,
timestamp: 1,
flags: 1,
add_channel(&net_graph_msg_handler, &secp_ctx, &our_privkey, &privkeys[7], ChannelFeatures::from_le_bytes(id_to_feature_flags(12)), 12);
update_channel(&net_graph_msg_handler, &secp_ctx, &our_privkey, UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 12,
timestamp: 1,
flags: 0,
excess_data: Vec::new()
});
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[7], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 12,
timestamp: 1,
flags: 1,
add_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[0], &privkeys[2], ChannelFeatures::from_le_bytes(id_to_feature_flags(3)), 3);
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[0], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 3,
timestamp: 1,
flags: 0,
excess_data: Vec::new()
});
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 3,
timestamp: 1,
flags: 1,
add_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[1], &privkeys[2], ChannelFeatures::from_le_bytes(id_to_feature_flags(4)), 4);
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[1], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 4,
timestamp: 1,
flags: 0,
excess_data: Vec::new()
});
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 4,
timestamp: 1,
flags: 1,
add_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[7], &privkeys[2], ChannelFeatures::from_le_bytes(id_to_feature_flags(13)), 13);
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[7], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 13,
timestamp: 1,
flags: 0,
excess_data: Vec::new()
});
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 13,
timestamp: 1,
flags: 1,
add_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[2], &privkeys[4], ChannelFeatures::from_le_bytes(id_to_feature_flags(6)), 6);
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 6,
timestamp: 1,
flags: 0,
excess_data: Vec::new()
});
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[4], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 6,
timestamp: 1,
flags: 1,
add_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[4], &privkeys[3], ChannelFeatures::from_le_bytes(id_to_feature_flags(11)), 11);
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[4], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 11,
timestamp: 1,
flags: 0,
excess_data: Vec::new()
});
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[3], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 11,
timestamp: 1,
flags: 1,
add_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[2], &privkeys[5], ChannelFeatures::from_le_bytes(id_to_feature_flags(7)), 7);
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[2], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 7,
timestamp: 1,
flags: 0,
excess_data: Vec::new()
});
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[5], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 7,
timestamp: 1,
flags: 1,
// // Disable channels 4 and 12 by flags=2
update_channel(&net_graph_msg_handler, &secp_ctx, &privkeys[1], UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 4,
timestamp: 2,
flags: 2, // to disable
excess_data: Vec::new()
});
update_channel(&net_graph_msg_handler, &secp_ctx, &our_privkey, UnsignedChannelUpdate {
- chain_hash: genesis_block(Network::Testnet).header.bitcoin_hash(),
+ chain_hash: genesis_block(Network::Testnet).header.block_hash(),
short_channel_id: 12,
timestamp: 2,
flags: 2, // to disable