Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/devnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,11 @@ impl Devnet {
*node.state.write().await = NodeState::Running;

if let (Some(ref p2p), Some(ref protocol)) = (&node.p2p_node, &node.ant_protocol) {
// Wire the P2PNode into the payment verifier for merkle-closeness checks.
protocol
.payment_verifier_arc()
.attach_p2p_node(Arc::clone(p2p));

let mut events = p2p.subscribe_events();
let p2p_clone = Arc::clone(p2p);
let protocol_clone = Arc::clone(protocol);
Expand Down
9 changes: 9 additions & 0 deletions src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ impl NodeBuilder {

let p2p_arc = Arc::new(p2p_node);

// Wire the P2PNode handle into the payment verifier so merkle-payment
// checks can query the live DHT for peers actually closest to a pool
// midpoint (pay-yourself defence).
if let Some(ref protocol) = ant_protocol {
protocol
.payment_verifier_arc()
.attach_p2p_node(Arc::clone(&p2p_arc));
}

// Initialize replication engine (if storage is enabled)
let replication_engine =
if let (Some(ref protocol), Some(fresh_rx)) = (&ant_protocol, fresh_write_rx) {
Expand Down
Loading
Loading