Skip to content

Commit 5206839

Browse files
committed
Fix P2P: remove incorrect .default on react-native-tcp-socket require
react-native-tcp-socket exports createConnection directly via module.exports, not as .default. The require was calling TcpSocket.default.createConnection which is undefined, causing a silent crash that was caught as a P2P error. Verified: Node.js test against seed1.fairco.in:46372 confirms handshake completes successfully with protocol version 71000. Also includes edge-to-edge scrolling improvements.
1 parent 8f54cf8 commit 5206839

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/p2p/socket-provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ function getElectronAPI(): ElectronAPI | undefined {
6767

6868
class NativeSocketProvider implements SocketProvider {
6969
connect(host: string, port: number): SocketConnection {
70-
const TcpSocket = require("react-native-tcp-socket") as { default: NativeTcpModule };
70+
const TcpSocket = require("react-native-tcp-socket") as NativeTcpModule;
7171

7272
let connectCallback: (() => void) | undefined;
7373

74-
const socket = TcpSocket.default.createConnection({ host, port }, () => {
74+
const socket = TcpSocket.createConnection({ host, port }, () => {
7575
if (connectCallback) {
7676
connectCallback();
7777
}

0 commit comments

Comments
 (0)