mirror of https://codeberg.org/pzp/pzp-sync.git
tiny renaming
This commit is contained in:
parent
832dbb9d33
commit
9f25aeeffa
|
@ -27,17 +27,17 @@ module.exports = {
|
|||
const algo = new Algorithm(peer)
|
||||
|
||||
const streams = []
|
||||
function createStream(remoteId, isClient) {
|
||||
function createStream(remoteId, iamClient) {
|
||||
// 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)
|
||||
streams.push(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 (!isClient) return
|
||||
if (!iamClient) return
|
||||
const local = toPull.duplex(createStream(rpc.id, true))
|
||||
|
||||
const remote = rpc.tangleSync.connect((networkError) => {
|
||||
|
|
Loading…
Reference in New Issue