disable auto-resend of not finished transactions on login-server restart

This commit is contained in:
einhornimmond 2021-09-20 12:22:56 +02:00
parent db15433cc2
commit f0cbed81f3
3 changed files with 4 additions and 18 deletions

View File

@ -57,6 +57,7 @@ namespace ServerConfig {
int g_FakeLoginSleepTime = 820;
std::string g_versionString = "";
bool g_disableEmail = false;
bool g_resendTransactionOnStart = false;
ServerSetupType g_ServerSetupType = SERVER_TYPE_PRODUCTION;
std::string g_devDefaultGroup = "";
std::string g_gRPCRelayServerFullURL;
@ -259,23 +260,7 @@ namespace ServerConfig {
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_ALLOW_ALL_PASSWORDS);
}
g_gRPCRelayServerFullURL = cfg.getString("grpc.server", "");
// unsecure flags
//g_AllowUnsecureFlags
if (cfg.getInt("unsecure.allow_passwort_via_json_request", 0) == 1) {
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_PASSWORD_REQUESTS);
}
if (cfg.getInt("unsecure.allow_auto_sign_transactions", 0) == 1) {
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_AUTO_SIGN_TRANSACTIONS);
}
if (cfg.getInt("unsecure.allow_cors_all", 0) == 1) {
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_CORS_ALL);
}
if (cfg.getInt("unsecure.allow_all_passwords", 0) == 1) {
g_AllowUnsecureFlags = (AllowUnsecure)(g_AllowUnsecureFlags | UNSECURE_ALLOW_ALL_PASSWORDS);
}
g_resendTransactionOnStart = cfg.getBool("dev.resend_unfinished_transactions_on_start", false);
return true;
}

View File

@ -73,6 +73,7 @@ namespace ServerConfig {
extern int g_FakeLoginSleepTime;
extern std::string g_versionString;
extern bool g_disableEmail;
extern bool g_resendTransactionOnStart;
extern ServerSetupType g_ServerSetupType;
extern std::string g_devDefaultGroup;
extern std::string g_gRPCRelayServerFullURL;

View File

@ -204,7 +204,7 @@ namespace model {
}
}
// try not finished but signed transactions again
if (!finished) {
if (!finished && ServerConfig::g_resendTransactionOnStart) {
transaction->ifEnoughSignsProceed(nullptr);
}