Permalink
Browse files

Merge branch 'dev'

  • Loading branch information...
SkaZun committed Jan 25, 2019
2 parents 4a1f073 + 91e1b0f commit f858a77cfa0b56b09d79f32df557dc1f9a3b3634
@@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_BUILD, 6)
define(_CLIENT_VERSION_BUILD, 7)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)
AC_INIT([ESBC Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[http://esbproject.online/],[esbcoin])
@@ -58,19 +58,17 @@ static Checkpoints::MapCheckpoints mapCheckpoints =
(217, uint256("56bfbbb7e9cf2adb82cae20a38770d9fb83a58f37661c01dbee87452372c408e"))
(5755, uint256("9a16af3d059ddd6306d65329e4398d1c62d7b421a815654606d0e1ecc7618e83"))
(10332, uint256("2cc3d1933f1ade777bea4522119064b49599a04b12a6a052030c21ee067f9d6e"))
(15135, uint256("4e2b745b89aa52bce3f2b693c55fe414352b1f582ee9d7daca2efb37a5c216a9"))
(20121, uint256("6f6525a1132fd3ef63c118a6196d7f4f75394af29f727484a630d3d67d700a3a"))
(27855, uint256("50b716f0972e4c96fa34dfd40e83b8b8075872a20a9954331580e4875ce4f27d"))
(29677, uint256("5b0b784dd34941f31d30e242c5c098bc5ba10d53bca71d4a14b8581254846d19"))
(32995, uint256("4de7a1887ff2e7b00091faedd8695c503a3cbe3340847c661d5143b64022f546"))
(35490, uint256("99726b1149641f183d8a02f0b4d4831491dc30ff9114cd80ee20043e9e17b674"))
(59183, uint256("5adc5fed6e4d3eef0e4e9d474b974b05490525e4335162ea7998ee3712568573"))
(100000, uint256("2b0d605f070fd590dccf1ebb9d80b68d1407c5680a9f94d50ba18151bb1c2ce3"))
(115900, uint256("c534b4328cea227b57a124dc14c18cd62e68214cd1b1a73933ae39a256f9da00"))
;

static const Checkpoints::CCheckpointData data = {
&mapCheckpoints,
1545043800, // * UNIX timestamp of last checkpoint block
140612, // * total number of transactions between genesis and last checkpoint
1548433598, // * UNIX timestamp of last checkpoint block
284631, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
4000 // * estimated number of transactions per day after checkpoint
};
@@ -88,7 +88,7 @@ static std::string FormatVersion(int nVersion)

std::string FormatFullVersion()
{
return "2.0.4.6";
return "2.0.4.7";
// return CLIENT_BUILD;
}

@@ -17,7 +17,7 @@
#define CLIENT_VERSION_MAJOR 2
#define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_REVISION 4
#define CLIENT_VERSION_BUILD 6
#define CLIENT_VERSION_BUILD 7

//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
@@ -3561,6 +3561,16 @@ bool ProcessNewBlock(CValidationState& state, CNode* pfrom, CBlock* pblock, CDis
return error("%s : CheckBlock FAILED for block %s", __func__, pblock->GetHash().GetHex());
}

// stake input check for prevent "Spent Stake" vulnerability
if (pblock->IsProofOfStake()) {
//LogPrintf("%s : check stake inputs\n", __func__);
CCoinsViewCache coins(pcoinsTip);
// check stake inputs in current coinsView and reject block if inputs are not allowed
if (!coins.HaveInputs(pblock->vtx[1]))
return state.DoS(100, error("%s : stake inputs missing/spent", __func__));
// additional checks are not required because the minimum staking time is higher than the reorganization limit.
}

// Store to disk
CBlockIndex* pindex = NULL;
bool ret = AcceptBlock(*pblock, state, &pindex, dbp, checked);
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>576</width>
<height>442</height>
<height>469</height>
</rect>
</property>
<property name="windowTitle">
@@ -263,7 +263,7 @@
<item>
<widget class="QLabel" name="stakeThresholdLabel">
<property name="text">
<string>Value:</string>
<string>Threshold value:</string>
</property>
</widget>
</item>
@@ -334,34 +334,80 @@
<number>0</number>
</property>
<item>
<widget class="QLabel" name="autoCombineLabel">
<property name="text">
<string>Value:</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="autoCombineSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>5000</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="autoCombineEdit">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>5000</number>
</property>
</widget>
<layout class="QGridLayout" name="autoCombineGrid">
<item row="0" column="1">
<widget class="QSlider" name="autoCombineSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>5000</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QSpinBox" name="autoCombineEdit">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>5000</number>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="autoCombineLabel">
<property name="toolTip">
<string>Combine outputs, within the same address, to the setting value. A standard transaction will be created, one combine operation on each chain block.</string>
</property>
<property name="text">
<string>Autocombine value:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="autoCombineLimitLabel">
<property name="toolTip">
<string>Do not affect the inputs with the number of confirmations over the limit ( 0 = disabled, confirmations are not checked )</string>
</property>
<property name="text">
<string>Confirmations limit:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSlider" name="autoCombineLimitSlider">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>5000</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSpinBox" name="autoCombineLimitEdit">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>5000</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
@@ -261,7 +261,7 @@ void MasternodeList::updateMyMasternodeInfo(QString strAlias, QString strAddr, C
QTableWidgetItem* statusItem = new QTableWidgetItem(QString::fromStdString(pmn ? pmn->Status() : "MISSING"));
int64_t activeSeconds = pmn ? pmn->lastPing.sigTime - pmn->sigTime : 0;
GUIUtil::DHMSTableWidgetItem* activeSecondsItem = new GUIUtil::DHMSTableWidgetItem(pmn ? activeSeconds : 0);
QTableWidgetItem* lastSeenItem = new QTableWidgetItem(QString::fromStdString(DateTimeStrFormat("%Y-%m-%d %H:%M", pmn ? pmn->lastPing.sigTime : 0)));
QTableWidgetItem* lastSeenItem = new QTableWidgetItem(QString::fromStdString(DateTimeStrFormat("%Y-%m-%d %H:%M", pmn ? pmn->lastPing.sigTime + GetOffsetFromUtc() : 0)));
QTableWidgetItem* pubkeyItem = new QTableWidgetItem(QString::fromStdString(pmn ? pubkey : ""));
QTableWidgetItem* mnReward = new QTableWidgetItem(QString::number(masternodeCoins/COIN,'f',1));
//mnReward->setTextAlignment(Qt::AlignRight);
@@ -219,6 +219,7 @@ void OptionsDialog::setMapper()
mapper->addMapping(ui->stakeThresholdEdit, OptionsModel::StakeSplitThreshold);
mapper->addMapping(ui->autoCombineEdit, OptionsModel::AutoCombineRewards);
mapper->addMapping(ui->autoCombineCheckBox, OptionsModel::AutoCombine);
mapper->addMapping(ui->autoCombineLimitEdit, OptionsModel::AutoCombineLimit);

/* Network */
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
@@ -291,8 +292,9 @@ void OptionsDialog::on_okButton_clicked()
mapper->submit();
obfuScationPool.cachedNumBlocks = std::numeric_limits<int>::max();

setStakeSplitThreshold();
setAutoCombineRewards();
//setStakeSplitThreshold();
//setAutoCombineRewards();
setWalletOptions();

pwalletMain->MarkDirty();
accept();
@@ -356,21 +358,31 @@ void OptionsDialog::on_stakeThresholdEdit_valueChanged(int i)
ui->stakeThresholdSlider->setValue(i);
}

void OptionsDialog::on_autoCombineEdit_valueChanged(int i)
void OptionsDialog::on_stakeThresholdSlider_valueChanged(int value)
{
ui->autoCombineSlider->setValue(i);
ui->stakeThresholdEdit->setValue(value);
}

void OptionsDialog::on_stakeThresholdSlider_valueChanged(int value)
void OptionsDialog::on_autoCombineEdit_valueChanged(int i)
{
ui->stakeThresholdEdit->setValue(value);
ui->autoCombineSlider->setValue(i);
}

void OptionsDialog::on_autoCombineSlider_valueChanged(int value)
{
ui->autoCombineEdit->setValue(value);
}

void OptionsDialog::on_autoCombineLimitEdit_valueChanged(int i)
{
ui->autoCombineLimitSlider->setValue(i);
}

void OptionsDialog::on_autoCombineLimitSlider_valueChanged(int value)
{
ui->autoCombineLimitEdit->setValue(value);
}

void OptionsDialog::on_autoCombineCheckBox_stateChanged(int state)
{
if (state == Qt::Checked) {
@@ -380,7 +392,37 @@ void OptionsDialog::on_autoCombineCheckBox_stateChanged(int state)
}
}

void OptionsDialog::setWalletOptions()
{
QSettings settings;

uint64_t nStakeSplitThreshold = settings.value("nStakeSplitThreshold").toInt();

bool AutoCombine = settings.value("bAutoCombine").toBool();
int AutoCombineRewards = settings.value("nAutoCombineRewards").toInt();
int AutoCombineLimit = settings.value("nAutoCombineLimit").toInt();

if (pwalletMain) {
CWalletDB walletdb(pwalletMain->strWalletFile);
LOCK(pwalletMain->cs_wallet);
{
/* Update StakeSplitThreshold's value in wallet */
pwalletMain->nStakeSplitThreshold = nStakeSplitThreshold;
/* Update AutoCombineRewards value in wallet */
pwalletMain->fCombineDust = AutoCombine;
pwalletMain->nAutoCombineThreshold = AutoCombineRewards;
pwalletMain->nAutoCombineLimit = AutoCombineLimit;
/* Write settings to wallet */
if (pwalletMain->fFileBacked) {
walletdb.WriteStakeSplitThreshold(nStakeSplitThreshold);
walletdb.WriteAutoCombineSettings(AutoCombine, AutoCombineRewards, AutoCombineLimit);
}
}
}
}

/* Update StakeSplitThreshold's value in wallet */
/*
void OptionsDialog::setStakeSplitThreshold()
{
QSettings settings;
@@ -398,13 +440,15 @@ void OptionsDialog::setStakeSplitThreshold()
}
}
}

*/
/* Update AutoCombineRewards value in wallet */
/*
void OptionsDialog::setAutoCombineRewards()
{
QSettings settings;
bool AutoCombine = settings.value("bAutoCombine").toBool();
int AutoCombineRewards = settings.value("nAutoCombineRewards").toInt();
int AutoCombineLimit = settings.value("nAutoCombineLimit").toInt();
if (pwalletMain && (pwalletMain->fCombineDust != AutoCombine || pwalletMain->nAutoCombineThreshold != AutoCombineRewards)) {
CWalletDB walletdb(pwalletMain->strWalletFile);
@@ -413,8 +457,9 @@ void OptionsDialog::setAutoCombineRewards()
pwalletMain->fCombineDust = AutoCombine;
pwalletMain->nAutoCombineThreshold = AutoCombineRewards;
if (pwalletMain->fFileBacked)
walletdb.WriteAutoCombineSettings(AutoCombine, AutoCombineRewards);
walletdb.WriteAutoCombineSettings(AutoCombine, AutoCombineRewards, AutoCombineLimit);
}
}
}
*/
@@ -32,9 +32,11 @@ class OptionsDialog : public QDialog
void setMapper();

/* Update StakeSplitThreshold's value in wallet */
void setStakeSplitThreshold();
// void setStakeSplitThreshold();
/* Update AutoCombineRewards value in wallet */
void setAutoCombineRewards();
// void setAutoCombineRewards();
/* Update Settings value in wallet */
void setWalletOptions();

protected:
bool eventFilter(QObject* object, QEvent* event);
@@ -56,8 +58,10 @@ private slots:

void on_stakeThresholdEdit_valueChanged(int i);
void on_autoCombineEdit_valueChanged(int i);
void on_autoCombineLimitEdit_valueChanged(int i);
void on_stakeThresholdSlider_valueChanged(int value);
void on_autoCombineSlider_valueChanged(int value);
void on_autoCombineLimitSlider_valueChanged(int value);
void on_autoCombineCheckBox_stateChanged(int state);

signals:
@@ -117,6 +117,8 @@ void OptionsModel::Init()
settings.setValue("nAutoCombineRewards", 500);
if (!settings.contains("bAutoCombine"))
settings.setValue("bAutoCombine", false);
if (!settings.contains("nAutoCombineLimit"))
settings.setValue("nAutoCombineLimit", 0);

// Network
if (!settings.contains("fUseUPnP"))
@@ -230,6 +232,10 @@ QVariant OptionsModel::data(const QModelIndex& index, int role) const
if (pwalletMain)
return QVariant((bool)pwalletMain->fCombineDust);
return settings.value("bAutoCombine");
case AutoCombineLimit:
if (pwalletMain)
return QVariant((int)pwalletMain->nAutoCombineLimit);
return settings.value("nAutoCombineLimit");
#endif

case DisplayUnit:
@@ -341,6 +347,9 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int
settings.setValue("bAutoCombine", value);
}
break;
case AutoCombineLimit:
settings.setValue("nAutoCombineLimit", value.toInt());
break;

case DisplayUnit:
setDisplayUnit(value);
@@ -54,6 +54,7 @@ class OptionsModel : public QAbstractListModel
StakeSplitThreshold, // int
AutoCombineRewards, // int
AutoCombine, // bool
AutoCombineLimit, // int
OptionIDRowCount,
};

Oops, something went wrong.

0 comments on commit f858a77

Please sign in to comment.