refreshAccounts function

void refreshAccounts()

Implementation

void refreshAccounts() {

  if (isUpdating) {
    return;
  }

  try {
    isUpdating = true;

    final errorBoxPointer = monero_flutter.buildErrorBoxPointer();
    monero_flutter.bindings.account_refresh(errorBoxPointer);
    final errorInfo = monero_flutter.extractErrorInfo(errorBoxPointer);

    if (0 != errorInfo.code) {
      throw Exception(errorInfo.getErrorMessage());
    }

    isUpdating = false;
  } catch (e) {
    isUpdating = false;
    rethrow;
  }
}