Support fast sync during initial block download
This commit is contained in:
@@ -185,9 +185,18 @@ void ConnectionLoader::createZcashConf() {
|
|||||||
out << "addnode=mainnet.z.cash\n";
|
out << "addnode=mainnet.z.cash\n";
|
||||||
out << "rpcuser=zec-qt-wallet\n";
|
out << "rpcuser=zec-qt-wallet\n";
|
||||||
out << "rpcpassword=" % randomPassword() << "\n";
|
out << "rpcpassword=" % randomPassword() << "\n";
|
||||||
|
|
||||||
|
// Fast sync override
|
||||||
|
if (ui.chkFastSync->isChecked()) {
|
||||||
|
out << "ibdskiptxverification=1\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
// Datadir override
|
||||||
if (!datadir.isEmpty()) {
|
if (!datadir.isEmpty()) {
|
||||||
out << "datadir=" % datadir % "\n";
|
out << "datadir=" % datadir % "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Tor override
|
||||||
if (useTor) {
|
if (useTor) {
|
||||||
out << "proxy=127.0.0.1:9050\n";
|
out << "proxy=127.0.0.1:9050\n";
|
||||||
}
|
}
|
||||||
@@ -623,6 +632,9 @@ std::shared_ptr<ConnectionConfig> ConnectionLoader::autoDetectZcashConf() {
|
|||||||
zcashconf->port.isEmpty()) {
|
zcashconf->port.isEmpty()) {
|
||||||
zcashconf->port = "18232";
|
zcashconf->port = "18232";
|
||||||
}
|
}
|
||||||
|
if (name == "ibdskiptxverification" && value == "1") {
|
||||||
|
zcashconf->skiptxverification = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If rpcport is not in the file, and it was not set by the testnet=1 flag, then go to default
|
// If rpcport is not in the file, and it was not set by the testnet=1 flag, then go to default
|
||||||
@@ -649,7 +661,7 @@ std::shared_ptr<ConnectionConfig> ConnectionLoader::loadFromSettings() {
|
|||||||
if (username.isEmpty() || password.isEmpty())
|
if (username.isEmpty() || password.isEmpty())
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
auto uiConfig = new ConnectionConfig{ host, port, username, password, false, false, "", "", ConnectionType::UISettingsZCashD};
|
auto uiConfig = new ConnectionConfig{ host, port, username, password, false, false, false, "", "", ConnectionType::UISettingsZCashD};
|
||||||
|
|
||||||
return std::shared_ptr<ConnectionConfig>(uiConfig);
|
return std::shared_ptr<ConnectionConfig>(uiConfig);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ struct ConnectionConfig {
|
|||||||
QString rpcpassword;
|
QString rpcpassword;
|
||||||
bool usingZcashConf;
|
bool usingZcashConf;
|
||||||
bool zcashDaemon;
|
bool zcashDaemon;
|
||||||
|
bool skiptxverification;
|
||||||
QString zcashDir;
|
QString zcashDir;
|
||||||
QString proxy;
|
QString proxy;
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>508</width>
|
<width>596</width>
|
||||||
<height>352</height>
|
<height>352</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -14,46 +14,27 @@
|
|||||||
<string>Configure zcash.conf</string>
|
<string>Configure zcash.conf</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="FilledIconLabel" name="lblTopIcon">
|
<widget class="QLabel" name="label">
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">background: #fff;</string>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string notr="true"/>
|
<string>Your zcash node will be configured for you automatically</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="scaledContents">
|
<property name="alignment">
|
||||||
<bool>true</bool>
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="Line" name="line">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="6" column="1">
|
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
<property name="centerButtons">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
|
<widget class="QCheckBox" name="chkFastSync">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enable Fast Sync</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="btnAdvancedConfig">
|
<widget class="QPushButton" name="btnAdvancedConfig">
|
||||||
@@ -80,17 +61,39 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="label">
|
<widget class="FilledIconLabel" name="lblTopIcon">
|
||||||
<property name="text">
|
<property name="sizePolicy">
|
||||||
<string>Your zcash node will be configured for you automatically</string>
|
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="styleSheet">
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
<string notr="true">background: #fff;</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="scaledContents">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="9" column="1">
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
<property name="centerButtons">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="1">
|
||||||
<widget class="QGroupBox" name="grpAdvanced">
|
<widget class="QGroupBox" name="grpAdvanced">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string/>
|
<string/>
|
||||||
@@ -165,6 +168,39 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="Line" name="line">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string><html><head/><body><p>Skips the most expensive checks during the initial block download. <a href="https://docs.zecwallet.co/using-zecwallet/#fastsync"><span style=" text-decoration: underline; color:#0000ff;">Learn More</span></a></p></body></html></string>
|
||||||
|
</property>
|
||||||
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="Line" name="line_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
|||||||
@@ -635,6 +635,14 @@ void RPC::getInfoThenRefresh(bool force) {
|
|||||||
ui->blockheight->setText(txt);
|
ui->blockheight->setText(txt);
|
||||||
ui->heightLabel->setText(QObject::tr("Downloading blocks"));
|
ui->heightLabel->setText(QObject::tr("Downloading blocks"));
|
||||||
} else {
|
} else {
|
||||||
|
// If syncing is finished, we may have to remove the ibdskiptxverification
|
||||||
|
// flag from zcash.conf
|
||||||
|
if (getConnection() != nullptr && getConnection()->config->skiptxverification) {
|
||||||
|
getConnection()->config->skiptxverification = false;
|
||||||
|
Settings::removeFromZcashConf(Settings::getInstance()->getZcashdConfLocation(),
|
||||||
|
"ibdskiptxverification");
|
||||||
|
}
|
||||||
|
|
||||||
ui->blockheight->setText(QString::number(blockNumber));
|
ui->blockheight->setText(QString::number(blockNumber));
|
||||||
ui->heightLabel->setText(QObject::tr("Block height"));
|
ui->heightLabel->setText(QObject::tr("Block height"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user