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
This changes adds the genesis block hash as a BlockHash to the
NetworkGraph struct. Making the NetworkGraph aware allows the message
handler to validate the chain_hash for received messages. This change
also adds the hash value to the Writeable and Readable methods.
let logger:Arc<Logger> = Arc::new(test_utils::TestLogger::new());
1676
1679
let chain_source = Arc::new(test_utils::TestChainSource::new(Network::Testnet));
1677
-
let net_graph_msg_handler = NetGraphMsgHandler::new(Some(chain_source.clone()),Arc::clone(&logger));
1680
+
let net_graph_msg_handler = NetGraphMsgHandler::new(genesis_block(Network::Testnet).header.block_hash(),Some(chain_source.clone()),Arc::clone(&logger));
1678
1681
1679
1682
let node_1_privkey = &SecretKey::from_slice(&[42;32]).unwrap();
1680
1683
let node_2_privkey = &SecretKey::from_slice(&[41;32]).unwrap();
let logger = Arc::new(test_utils::TestLogger::new());
541
-
let net_graph_msg_handler = NetGraphMsgHandler::new(None,Arc::clone(&logger));
541
+
let net_graph_msg_handler = NetGraphMsgHandler::new(genesis_block(Network::Testnet).header.block_hash(),None,Arc::clone(&logger));
542
542
// Build network from our_id to node7:
543
543
//
544
544
// -1(1)2- node0 -1(3)2-
@@ -1258,7 +1258,7 @@ mod tests {
1258
1258
inbound_capacity_msat:100000,
1259
1259
is_live:true,
1260
1260
}];
1261
-
let route = get_route(&source_node_id,&NetworkGraph::new(),&target_node_id,Some(&our_chans.iter().collect::<Vec<_>>()),&last_hops.iter().collect::<Vec<_>>(),100,42,Arc::new(test_utils::TestLogger::new())).unwrap();
1261
+
let route = get_route(&source_node_id,&NetworkGraph::new(genesis_block(Network::Testnet).header.block_hash()),&target_node_id,Some(&our_chans.iter().collect::<Vec<_>>()),&last_hops.iter().collect::<Vec<_>>(),100,42,Arc::new(test_utils::TestLogger::new())).unwrap();
0 commit comments