Skip to content

Commit

Permalink
Added -platformreindex to GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashot Khachatryan committed Aug 3, 2020
1 parent b989db3 commit 68993d5
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += " -pid=<file> " + strprintf(_("Specify pid file (default: %s)"), "crownd.pid") + "\n";
#endif
strUsage += " -reindex " + _("Rebuild block chain index from current blk000??.dat files") + " " + _("on startup") + "\n";
strUsage += " -platformreindex " + _("Rebuild platform database") + " " + _("on startup") + "\n";
#if !defined(WIN32)
strUsage += " -sysperms " + _("Create new files with system default permissions, instead of umask 077 (only effective with disabled wallet functionality)") + "\n";
#endif
Expand Down
29 changes: 29 additions & 0 deletions src/qt/forms/rpcconsole.ui
Original file line number Diff line number Diff line change
Expand Up @@ -1331,6 +1331,35 @@
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton" name="btn_platformreindex">
<property name="geometry">
<rect>
<x>10</x>
<y>390</y>
<width>301</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>Rebuild platform db</string>
</property>
</widget>
<widget class="QLabel" name="label_platform_reindex">
<property name="geometry">
<rect>
<x>330</x>
<y>380</y>
<width>411</width>
<height>41</height>
</rect>
</property>
<property name="text">
<string>-platformreindex: Rebuild platform database.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</widget>
</widget>
</item>
Expand Down
9 changes: 9 additions & 0 deletions src/qt/rpcconsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const QString ZAPTXES1("-zapwallettxes=1");
const QString ZAPTXES2("-zapwallettxes=2");
const QString UPGRADEWALLET("-upgradewallet");
const QString REINDEX("-reindex");
const QString PLATFORMREINDEX("-platformreindex");

const struct {
const char *url;
Expand Down Expand Up @@ -237,6 +238,7 @@ RPCConsole::RPCConsole(QWidget *parent) :
connect(ui->btn_zapwallettxes2, SIGNAL(clicked()), this, SLOT(walletZaptxes2()));
connect(ui->btn_upgradewallet, SIGNAL(clicked()), this, SLOT(walletUpgrade()));
connect(ui->btn_reindex, SIGNAL(clicked()), this, SLOT(walletReindex()));
connect(ui->btn_platformreindex, SIGNAL(clicked()), this, SLOT(walletPlatformReindex()));

// set library version labels
ui->openSSLVersion->setText(SSLeay_version(SSLEAY_VERSION));
Expand Down Expand Up @@ -392,6 +394,12 @@ void RPCConsole::walletReindex()
buildParameterlist(REINDEX);
}

/** Restart wallet with "-platformreindex" */
void RPCConsole::walletPlatformReindex()
{
buildParameterlist(PLATFORMREINDEX);
}

/** Build command-line parameter list for restart */
void RPCConsole::buildParameterlist(QString arg)
{
Expand All @@ -406,6 +414,7 @@ void RPCConsole::buildParameterlist(QString arg)
args.removeAll(ZAPTXES2);
args.removeAll(UPGRADEWALLET);
args.removeAll(REINDEX);
args.removeAll(PLATFORMREINDEX);

// Append repair parameter to command line.
args.append(arg);
Expand Down
1 change: 1 addition & 0 deletions src/qt/rpcconsole.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public slots:
void walletZaptxes2();
void walletUpgrade();
void walletReindex();
void walletPlatformReindex();

void reject();
void message(int category, const QString &message, bool html = false);
Expand Down

0 comments on commit 68993d5

Please sign in to comment.