Skip to content

Commit

Permalink
Merge pull request #23 from PirateNetwork/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
CryptoForge authored Jan 3, 2021
2 parents 64dfe1d + 4bef807 commit 5c48c7a
Show file tree
Hide file tree
Showing 6 changed files with 223 additions and 175 deletions.
13 changes: 5 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,15 @@ contrib/debian/files
contrib/debian/substvars

src/rpcmisc~.cpp
src/komodo-cli
src/pirate-cli
src/komodod
src/pirated
src/komodo-tx
src/pirate-tx
src/komodo-test
src/pirate-test
src/wallet-utility
src/komodo-cli.exe
src/komodod.exe
src/komodo-tx.exe
src/pirate-cli.exe
src/pirated.exe
src/pirate-tx.exe
src/pirate-test.exe
src/wallet-utility.exe
pirate-qt-win.exe
pirate-qt-linux
Expand All @@ -137,7 +134,7 @@ src/qt/*.moc
src/qt/forms/ui_*.h

#Mac Packaged App
PirateWallet.app
PirateOcean.app

#output during builds, symbol tables?
*.dSYM
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 3)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_BUILD, 50)
define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50)))
define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1)))
Expand Down
23 changes: 19 additions & 4 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ std::string HelpMessage(HelpMessageMode mode)
// strUsage += HelpMessageOpt("-prune=<n>", strprintf(_("Reduce storage requirements by pruning (deleting) old blocks. This mode disables wallet support and is incompatible with -txindex. "
// "Warning: Reverting this setting requires re-downloading the entire blockchain. "
// "(default: 0 = disable pruning blocks, >%u = target size in MiB to use for block files)"), MIN_DISK_SPACE_FOR_BLOCK_FILES / 1024 / 1024));
strUsage += HelpMessageOpt("-bootstrap", _("Download and install bootstrap on startup"));
strUsage += HelpMessageOpt("-bootstrap", _("Download and install bootstrap on startup (1 to show GUI prompt, 2 to force download when using CLI)"));
strUsage += HelpMessageOpt("-reindex", _("Rebuild block chain index from current blk000??.dat files on startup"));
#if !defined(WIN32)
strUsage += HelpMessageOpt("-sysperms", _("Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)"));
Expand Down Expand Up @@ -1672,7 +1672,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
if (!boost::filesystem::exists(GetDataDir() / "blocks") || !boost::filesystem::exists(GetDataDir() / "chainstate"))
newInstall = true;

if (newInstall) {
//Prompt on new install
if (newInstall && !GetBoolArg("-bootstrap", false)) {
bool fBoot = uiInterface.ThreadSafeMessageBox(
"\n\n" + _("New install detected.\n\nPress OK to download the blockchain bootstrap."),
"", CClientUIInterface::ICON_INFORMATION | CClientUIInterface::MSG_INFORMATION | CClientUIInterface::MODAL | CClientUIInterface::BTN_OK | CClientUIInterface::BTN_CANCEL);
Expand All @@ -1681,7 +1682,8 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
}

if (GetBoolArg("-bootstrap", false) && !useBootstrap) {
//Prompt GUI
if (GetBoolArg("-bootstrap", false) && GetArg("-bootstrap", "1") != "2" && !useBootstrap) {
bool fBoot = uiInterface.ThreadSafeMessageBox(
"\n\n" + _("Bootstrap option detected.\n\nPress OK to download the blockchain bootstrap."),
"", CClientUIInterface::ICON_INFORMATION | CClientUIInterface::MSG_INFORMATION | CClientUIInterface::MODAL | CClientUIInterface::BTN_OK | CClientUIInterface::BTN_CANCEL);
Expand All @@ -1690,6 +1692,11 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
}
}

//Force Download- used for CLI
if (GetBoolArg("-bootstrap", false) && GetArg("-bootstrap", "1") == "2") {
useBootstrap = true;
}

if (useBootstrap) {
fReindex = false;
//wipe transactions from wallet to create a clean slate
Expand All @@ -1700,7 +1707,15 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
boost::filesystem::remove(GetDataDir() / "komodostate");
boost::filesystem::remove(GetDataDir() / "signedmasks");
boost::filesystem::remove(GetDataDir() / "komodostate.ind");
getBootstrap();
if (!getBootstrap() && !fRequestShutdown ) {
bool keepRunning = uiInterface.ThreadSafeMessageBox(
"\n\n" + _("Bootstrap download failed!!!\n\nPress OK to continue and sync from the network."),
"", CClientUIInterface::ICON_INFORMATION | CClientUIInterface::MSG_INFORMATION | CClientUIInterface::MODAL | CClientUIInterface::BTN_OK | CClientUIInterface::BTN_CANCEL);

if (!keepRunning) {
fRequestShutdown = true;
}
}
}

if (fRequestShutdown)
Expand Down
Loading

0 comments on commit 5c48c7a

Please sign in to comment.