Merge pull request #529 from cake-tech/CW-182-allow-trusted-nodes

Cw 182 allow trusted nodes
This commit is contained in:
Omar Hatem
2022-12-04 02:17:35 +02:00
committed by GitHub
29 changed files with 123 additions and 17 deletions
+10
View File
@@ -927,6 +927,16 @@ extern "C"
return static_cast<int32_t>(rates.size());
}
void set_trusted_daemon(bool arg)
{
m_wallet->setTrustedDaemon(arg);
}
bool trusted_daemon()
{
return m_wallet->trustedDaemon();
}
#ifdef __cplusplus
}
#endif
+5 -1
View File
@@ -137,4 +137,8 @@ typedef get_rate = Pointer<Int64> Function();
typedef size_of_rate = Int32 Function();
typedef update_rate = Void Function();
typedef update_rate = Void Function();
typedef set_trusted_daemon = Void Function(Int8 trusted);
typedef trusted_daemon = Int8 Function();
+5 -1
View File
@@ -135,4 +135,8 @@ typedef GetRate = Pointer<Int64> Function();
typedef SizeOfRate = int Function();
typedef UpdateRate = void Function();
typedef UpdateRate = void Function();
typedef SetTrustedDaemon = void Function(int);
typedef TrustedDaemon = int Function();
+12
View File
@@ -116,6 +116,14 @@ final rescanBlockchainAsyncNative = havenApi
.lookup<NativeFunction<rescan_blockchain>>('rescan_blockchain')
.asFunction<RescanBlockchainAsync>();
final setTrustedDaemonNative = havenApi
.lookup<NativeFunction<set_trusted_daemon>>('set_trusted_daemon')
.asFunction<SetTrustedDaemon>();
final trustedDaemonNative = havenApi
.lookup<NativeFunction<trusted_daemon>>('trusted_daemon')
.asFunction<TrustedDaemon>();
int getSyncingHeight() => getSyncingHeightNative();
bool isNeededToRefresh() => isNeededToRefreshNative() != 0;
@@ -351,3 +359,7 @@ Future<bool> isConnected() => compute(_isConnected, 0);
Future<int> getNodeHeight() => compute(_getNodeHeight, 0);
void rescanBlockchainAsync() => rescanBlockchainAsyncNative();
Future setTrustedDaemon(bool trusted) async => setTrustedDaemonNative(_boolToInt(trusted));
Future<bool> trustedDaemon() async => trustedDaemonNative() != 0;
+2
View File
@@ -121,6 +121,8 @@ abstract class HavenWalletBase extends WalletBase<MoneroBalance,
password: node.password,
useSSL: node.useSSL ?? false,
isLightWallet: false); // FIXME: hardcoded value
haven_wallet.setTrustedDaemon(node.trusted);
syncStatus = ConnectedSyncStatus();
} catch (e) {
syncStatus = FailedSyncStatus();