Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(network, dht): NET-1392 rename source to remote in appropriate places #2970

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion packages/dht/src/connection/Handshaker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { version as applicationVersion } from '../../package.json'
const logger = new Logger(module)

interface HandshakerEvents {
handshakeRequest: (source: PeerDescriptor, protocolVersion: string, target?: PeerDescriptor) => void
handshakeRequest: (remote: PeerDescriptor, protocolVersion: string, target?: PeerDescriptor) => void
handshakeCompleted: (remote: PeerDescriptor) => void
handshakeFailed: (error?: HandshakeError) => void
}
Expand Down
2 changes: 1 addition & 1 deletion packages/dht/src/connection/webrtc/WebrtcConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class WebrtcConnector {
connection.once('localDescription', (description: string) => {
remoteConnector.sendRtcAnswer(description, connection.connectionId)
})
handshaker.on('handshakeRequest', (_sourceDescriptor: PeerDescriptor, remoteVersion: string) => {
handshaker.on('handshakeRequest', (_remoteDescriptor: PeerDescriptor, remoteVersion: string) => {
if (!isMaybeSupportedProtocolVersion(remoteVersion)) {
rejectHandshake(pendingConnection!, connection, handshaker, HandshakeError.UNSUPPORTED_PROTOCOL_VERSION)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class ContentDeliveryLayerNode extends EventEmitter<Events> {
rpcCommunicator: this.options.rpcCommunicator,
markAndCheckDuplicate: (msg: MessageID, prev?: MessageRef) => markAndCheckDuplicate(this.duplicateDetectors, msg, prev),
broadcast: (message: StreamMessage, previousNode?: DhtAddress) => this.broadcast(message, previousNode),
onLeaveNotice: (remoteNodeId: DhtAddress, sourceIsStreamEntryPoint: boolean) => {
onLeaveNotice: (remoteNodeId: DhtAddress, remoteIsStreamEntryPoint: boolean) => {
if (this.abortController.signal.aborted) {
return
}
Expand All @@ -107,7 +107,7 @@ export class ContentDeliveryLayerNode extends EventEmitter<Events> {
this.options.neighborFinder.start([remoteNodeId])
this.options.proxyConnectionRpcLocal?.removeConnection(remoteNodeId)
}
if (sourceIsStreamEntryPoint) {
if (remoteIsStreamEntryPoint) {
this.emit('entryPointLeaveDetected')
}
},
Expand Down
Loading