diff --git a/lib/index.js b/lib/index.js index 998ceb6..e3dbb75 100644 --- a/lib/index.js +++ b/lib/index.js @@ -47,19 +47,20 @@ module.exports = { if (!iamClient) return const local = toPull.duplex(createStream(rpc.id, true)) + let abort const remote = rpc.tangleSync.connect((networkError) => { if (networkError && getSeverity(networkError) >= 3) { if (isMuxrpcMissingError(networkError, 'tangleSync', 'connect')) { - console.warn(`peer ${rpc.id} does not support sync connect`) + debug('peer %s does not support tangleSync', rpc.id) // } else if (isReconnectedError(networkError)) { // TODO: bring back // Do nothing, this is a harmless error } else { console.error(`rpc.tangleSync.connect exception:`, networkError) } + abort?.(true, () => {}) } }) - - pull(local, remote, local) + abort = pull(local, remote, local) }) function connect() {