Skip to content

Commit e1c1177

Browse files
authored
Merge pull request #995 from PayButton/fix/joining-rooms
fix: client not receiving broadcast tx
2 parents 3e101b8 + 5fe528f commit e1c1177

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ws-service/route.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ function handleConnection ({ namespace, socket, addressList }: HandleConnectionA
4646
totalConnectedInNamespace
4747
}
4848
if (addressList !== undefined) info.addressList = addressList
49+
if (info.addressList?.length !== 0) {
50+
info.addressList?.forEach(address => {
51+
void socket.join(address)
52+
})
53+
}
4954
console.log(`/${namespace} —`, info)
5055
void socket.on('disconnect', (reason: DisconnectReason, description: any) => {
5156
console.log(`/${namespace}${socket.id} DISCONNECTED`)
@@ -118,7 +123,8 @@ const altpaymentRouteConnection = async (socket: Socket): Promise<void> => {
118123
const headersForwardedAddresses = socket.handshake.headers['x-forwarded-for'] as string
119124
const userIp = headersForwardedAddresses === undefined ? '' : headersForwardedAddresses.split(',')[0]
120125
if (userIp === '') {
121-
throw new Error('Local IP not defined.')
126+
console.error('Local IP not defined.')
127+
return
122128
// userIp = (await (await fetch("<PUBLIC_IP_PROVIDER>", { headers: { 'Accept': 'application/json' } })).json())[<PUBLIC_IP_PROVIDER_IP_KEY>]
123129
}
124130
const userIpAlt = socket.handshake.address

0 commit comments

Comments
 (0)