multistream protocol now has a protocol interface
This commit is contained in:
parent
407f85bc89
commit
7dbb6fca29
9 changed files with 38 additions and 79 deletions
|
@ -19,7 +19,7 @@ int ipfs_bitswap_network_send_message(const struct BitswapContext* context, stru
|
|||
libp2p_logger_debug("bitswap_network", "Sending bitswap message to %s.\n", libp2p_peer_id_to_string(peer));
|
||||
// get a connection to the peer
|
||||
if (peer->connection_type != CONNECTION_TYPE_CONNECTED) {
|
||||
libp2p_peer_connect(&context->ipfsNode->identity->private_key, peer, context->ipfsNode->peerstore, 10);
|
||||
libp2p_peer_connect(&context->ipfsNode->identity->private_key, peer, context->ipfsNode->peerstore, context->ipfsNode->repo->config->datastore, 10);
|
||||
if(peer->connection_type != CONNECTION_TYPE_CONNECTED)
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -384,7 +384,7 @@ int ipfs_bitswap_peer_request_process_entry(const struct BitswapContext* context
|
|||
if (need_to_connect) {
|
||||
if (!connected) {
|
||||
// connect
|
||||
connected = libp2p_peer_connect(&context->ipfsNode->identity->private_key, request->peer, context->ipfsNode->peerstore, 0);
|
||||
connected = libp2p_peer_connect(&context->ipfsNode->identity->private_key, request->peer, context->ipfsNode->peerstore, context->ipfsNode->repo->config->datastore, 0);
|
||||
}
|
||||
if (connected) {
|
||||
// build a message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue