Require renter settings to mount
This commit is contained in:
@@ -274,6 +274,7 @@ void CSiaDriveApp::OnContextCreated(
|
||||
obj->SetValue("isWalletConfigured", CefV8Value::CreateBool(_siaApi->GetWallet()->GetCreated()), V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
obj->SetValue("isOnline", CefV8Value::CreateBool(_siaApi->GetWallet()->GetConnected()), V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
obj->SetValue("clientVersion", CefV8Value::CreateString(SIDRIVE_VERSION_STRING), V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
obj->SetValue("allocatedRenterFunds", CefV8Value::CreateString(_siaApi->GetRenter()->GetFunds().ToString()), V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
global->SetValue("uiState", obj, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
|
||||
CefRefPtr<FunctionHandler> handler(new FunctionHandler(*_siaApi, _appStarted, _siaDriveConfig, _siaDrive, [this]() {this->ShutdownServices(); }, [this](CefRefPtr<CefV8Context> context) {this->SiaApiRefreshCallback(context, *_siaCurl, _siaDriveConfig.get()); }));
|
||||
|
@@ -80,6 +80,13 @@ void CSiaApi::_CSiaRenter::Refresh(const CSiaCurl& siaCurl, CSiaDriveConfig* sia
|
||||
SetPeriod(period);
|
||||
_currentAllowance = { funds, hosts, period, renewWindow };
|
||||
|
||||
if (_currentAllowance.Funds == 0)
|
||||
{
|
||||
_currentAllowance.Funds = SIA_DEFAULT_MINIMUM_FUNDS;
|
||||
_currentAllowance.Hosts = SIA_DEFAULT_HOST_COUNT;
|
||||
_currentAllowance.Period = SIA_BLOCKS_PER_MONTH * 3;
|
||||
_currentAllowance.RenewWindowInBlocks = SIA_DEFAULT_RENEW_WINDOW;
|
||||
}
|
||||
if (ApiSuccess(RefreshFileTree()))
|
||||
{
|
||||
CSiaFileTreePtr fileTree;
|
||||
|
Reference in New Issue
Block a user