tiny renaming

This commit is contained in:
Andre Staltz 2023-04-12 12:03:31 +03:00
parent 832dbb9d33
commit 9f25aeeffa
1 changed files with 4 additions and 4 deletions

View File

@ -27,17 +27,17 @@ module.exports = {
const algo = new Algorithm(peer) const algo = new Algorithm(peer)
const streams = [] const streams = []
function createStream(remoteId, isClient) { function createStream(remoteId, iamClient) {
// prettier-ignore // prettier-ignore
debug('Opening a stream with remote %s %s', isClient ? 'server' : 'client', remoteId) debug('Opening a stream with remote %s %s', iamClient ? 'server' : 'client', remoteId)
const stream = new SyncStream(peer.id, debug, algo) const stream = new SyncStream(peer.id, debug, algo)
streams.push(stream) streams.push(stream)
return stream return stream
} }
peer.on('rpc:connect', function onSyncRPCConnect(rpc, isClient) { peer.on('rpc:connect', function onSyncRPCConnect(rpc, iamClient) {
if (rpc.id === peer.id) return // local client connecting to local server if (rpc.id === peer.id) return // local client connecting to local server
if (!isClient) return if (!iamClient) return
const local = toPull.duplex(createStream(rpc.id, true)) const local = toPull.duplex(createStream(rpc.id, true))
const remote = rpc.tangleSync.connect((networkError) => { const remote = rpc.tangleSync.connect((networkError) => {