mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-25 12:06:05 +00:00
make init async so it won't lag
disable print starts
This commit is contained in:
parent
f6d41f318e
commit
e68cae6bf4
2 changed files with 13 additions and 10 deletions
|
@ -59,13 +59,13 @@ int getNodeHeightSync() => monero.Wallet_daemonBlockChainHeight(wptr!);
|
||||||
|
|
||||||
bool isConnectedSync() => monero.Wallet_connected(wptr!) != 0;
|
bool isConnectedSync() => monero.Wallet_connected(wptr!) != 0;
|
||||||
|
|
||||||
bool setupNodeSync(
|
Future<bool> setupNodeSync(
|
||||||
{required String address,
|
{required String address,
|
||||||
String? login,
|
String? login,
|
||||||
String? password,
|
String? password,
|
||||||
bool useSSL = false,
|
bool useSSL = false,
|
||||||
bool isLightWallet = false,
|
bool isLightWallet = false,
|
||||||
String? socksProxyAddress}) {
|
String? socksProxyAddress}) async {
|
||||||
print('''
|
print('''
|
||||||
{
|
{
|
||||||
wptr!,
|
wptr!,
|
||||||
|
@ -76,12 +76,15 @@ bool setupNodeSync(
|
||||||
daemonPassword: $password ?? ''
|
daemonPassword: $password ?? ''
|
||||||
}
|
}
|
||||||
''');
|
''');
|
||||||
monero.Wallet_init(wptr!,
|
final addr = wptr!.address;
|
||||||
|
await Isolate.run(() {
|
||||||
|
monero.Wallet_init(Pointer.fromAddress(addr),
|
||||||
daemonAddress: address,
|
daemonAddress: address,
|
||||||
useSsl: useSSL,
|
useSsl: useSSL,
|
||||||
proxyAddress: socksProxyAddress ?? '',
|
proxyAddress: socksProxyAddress ?? '',
|
||||||
daemonUsername: login ?? '',
|
daemonUsername: login ?? '',
|
||||||
daemonPassword: password ?? '');
|
daemonPassword: password ?? '');
|
||||||
|
});
|
||||||
// monero.Wallet_init3(wptr!, argv0: '', defaultLogBaseName: 'moneroc', console: true);
|
// monero.Wallet_init3(wptr!, argv0: '', defaultLogBaseName: 'moneroc', console: true);
|
||||||
|
|
||||||
final status = monero.Wallet_status(wptr!);
|
final status = monero.Wallet_status(wptr!);
|
||||||
|
@ -219,7 +222,7 @@ void onStartup() {}
|
||||||
|
|
||||||
void _storeSync(Object _) => storeSync();
|
void _storeSync(Object _) => storeSync();
|
||||||
|
|
||||||
bool _setupNodeSync(Map<String, Object?> args) {
|
Future<bool> _setupNodeSync(Map<String, Object?> args) async {
|
||||||
final address = args['address'] as String;
|
final address = args['address'] as String;
|
||||||
final login = (args['login'] ?? '') as String;
|
final login = (args['login'] ?? '') as String;
|
||||||
final password = (args['password'] ?? '') as String;
|
final password = (args['password'] ?? '') as String;
|
||||||
|
|
|
@ -16,7 +16,7 @@ final monero.WalletManager wmPtr = Pointer.fromAddress((() {
|
||||||
// Problems with the wallet? Crashes? Lags? this will print all calls to xmr
|
// Problems with the wallet? Crashes? Lags? this will print all calls to xmr
|
||||||
// codebase, so it will be easier to debug what happens. At least easier
|
// codebase, so it will be easier to debug what happens. At least easier
|
||||||
// than plugging gdb in. Especially on windows/android.
|
// than plugging gdb in. Especially on windows/android.
|
||||||
monero.printStarts = kDebugMode;
|
monero.printStarts = false;
|
||||||
_wmPtr ??= monero.WalletManagerFactory_getWalletManager();
|
_wmPtr ??= monero.WalletManagerFactory_getWalletManager();
|
||||||
print("ptr: $_wmPtr");
|
print("ptr: $_wmPtr");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in a new issue