cypherstack / tor

Tor plugin for Flutter
Other
0 stars 0 forks source link

SOCKSSocket: _secureSocksSocket initialization failure #24

Open sneurlax opened 9 months ago

sneurlax commented 9 months ago
flutter: Log: [Error][2023-09-28 23:20:20.414Z]: JsonRPC.connect(): failed to connect to bitcoincash.stackwallet.com over tor proxy at (host: InternetAddress('127.0.0.1', IPv4), port: 5146), Exception: socks_socket.connectTo(): Failed to connect to target through SOCKS5 proxy.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: LateInitializationError: Field '_secureSocksSocket@76127678' has not been initialized.
#0      SOCKSSocket._secureSocksSocket (package:tor_ffi_plugin/socks_socket.dart)
#1      SOCKSSocket.write (package:tor_ffi_plugin/socks_socket.dart:268:7)
#2      JsonRPC._sendNextAvailableRequest.<anonymous closure> (package:stackwallet/electrumx_rpc/rpc.dart:88:25)
<asynchronous suspension>

Has happened twice now.

We attempt to return a _secureSocksSocket which has failed to initialize/connect.

sneurlax commented 9 months ago

See https://github.com/cypherstack/tor/blob/main/lib/socks_socket.dart#L267-L271

write should essentially await connection or similar