Skip to content

Commit 7d9b8c0

Browse files
authored
Merge pull request LIMXTEC#61 from LIMXTEC/0.90.8.x
0.90.8.9
2 parents 6b5e1e6 + 331a80f commit 7d9b8c0

14 files changed

Lines changed: 93 additions & 125 deletions

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ AC_PREREQ([2.60])
33
define(_CLIENT_VERSION_MAJOR, 0)
44
define(_CLIENT_VERSION_MINOR, 90)
55
define(_CLIENT_VERSION_REVISION, 8)
6-
define(_CLIENT_VERSION_BUILD, 8)
6+
define(_CLIENT_VERSION_BUILD, 9)
77
define(_CLIENT_VERSION_IS_RELEASE, true)
88
define(_COPYRIGHT_YEAR, 2020)
99
define(_COPYRIGHT_HOLDERS,[The %s developers])

src/masternode-payments.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,8 @@ bool CMasternodePaymentVote::CheckSignature(const CPubKey& pubKeyMasternode, int
876876
// and we have no idea about the old one.
877877
if(masternodeSync.IsMasternodeListSynced() && nBlockHeight > nValidationHeight) {
878878
nDos = 20;
879+
return error("CMasternodePaymentVote::CheckSignature -- Got bad Masternode payment signature, masternode=%s, error: %s", vinMasternode.prevout.ToStringShort().c_str(), strError);
879880
}
880-
return error("CMasternodePaymentVote::CheckSignature -- Got bad Masternode payment signature, masternode=%s, error: %s", vinMasternode.prevout.ToStringShort().c_str(), strError);
881881
}
882882

883883
return true;

src/masternode.cpp

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ arith_uint256 CMasternode::CalculateScore(const uint256& blockHash)
105105
return UintToArith256(ss.GetHash());
106106
}
107107

108+
/*
108109
CMasternode::CollateralStatus CMasternode::CheckCollateral(const COutPoint& outpoint)
109110
{
110-
int nHeight;
111-
return CheckCollateral(outpoint, nHeight);
111+
return CheckCollateral(outpoint);
112112
}
113-
114-
CMasternode::CollateralStatus CMasternode::CheckCollateral(const COutPoint& outpoint, int& nHeightRet)
113+
*/
114+
CMasternode::CollateralStatus CMasternode::CheckCollateral(const COutPoint& outpoint)
115115
{
116116
AssertLockHeld(cs_main);
117117

@@ -120,17 +120,12 @@ CMasternode::CollateralStatus CMasternode::CheckCollateral(const COutPoint& outp
120120
return COLLATERAL_UTXO_NOT_FOUND;
121121
}
122122

123-
// FXTC BEGIN
124-
nHeightRet = coin.nHeight;
125-
126123
CMasternode cm;
127-
//if(coin.out.nValue != 1000 * COIN) {
128-
if(!cm.CollateralValueCheck(coin.nHeight,coin.out.nValue)) {
129-
// FXTC END
124+
if(coin.out.nValue != Params().GetConsensus().nMasternodeCollateralMinimum * COIN)
125+
{
130126
return COLLATERAL_INVALID_AMOUNT;
131127
}
132-
133-
nHeightRet = coin.nHeight;
128+
134129
return COLLATERAL_OK;
135130
}
136131

@@ -226,7 +221,7 @@ void CMasternode::Check(bool fForce)
226221

227222
if(fWaitForPing && !fOurMasternode) {
228223
// ...but if it was already expired before the initial check - return right away
229-
if(IsExpired() || IsWatchdogExpired() || IsNewStartRequired()) {
224+
if(IsExpired() || IsNewStartRequired()) {
230225
LogPrint(BCLog::MASTERNODE, "CMasternode::Check -- Masternode %s is in %s state, waiting for ping\n", vin.prevout.ToStringShort(), GetStateString());
231226
return;
232227
}
@@ -243,22 +238,6 @@ void CMasternode::Check(bool fForce)
243238
return;
244239
}
245240

246-
bool fWatchdogActive = masternodeSync.IsSynced() && mnodeman.IsWatchdogActive();
247-
//bool fWatchdogExpired = (fWatchdogActive && ((GetAdjustedTime() - nTimeLastWatchdogVote) > MASTERNODE_WATCHDOG_MAX_SECONDS));
248-
bool fWatchdogExpired = false;
249-
250-
//LogPrint(BCLog::MASTERNODE, "CMasternode::Check -- outpoint=%s, nTimeLastWatchdogVote=%d, GetAdjustedTime()=%d, fWatchdogExpired=%d\n", vin.prevout.ToStringShort(), nTimeLastWatchdogVote, GetAdjustedTime(), fWatchdogExpired);
251-
252-
253-
if(fWatchdogExpired) {
254-
nActiveState = MASTERNODE_WATCHDOG_EXPIRED;
255-
if(nActiveStatePrev != nActiveState) {
256-
LogPrint(BCLog::MASTERNODE, "CMasternode::Check -- Masternode %s is in %s state now\n", vin.prevout.ToStringShort(), GetStateString());
257-
}
258-
return;
259-
}
260-
261-
262241
if(!IsPingedWithin(MASTERNODE_EXPIRATION_SECONDS)) {
263242
nActiveState = MASTERNODE_EXPIRED;
264243
if(nActiveStatePrev != nActiveState) {
@@ -330,7 +309,6 @@ std::string CMasternode::StateToString(int nStateIn)
330309
case MASTERNODE_EXPIRED: return "EXPIRED";
331310
case MASTERNODE_OUTPOINT_SPENT: return "OUTPOINT_SPENT";
332311
case MASTERNODE_UPDATE_REQUIRED: return "UPDATE_REQUIRED";
333-
case MASTERNODE_WATCHDOG_EXPIRED: return "WATCHDOG_EXPIRED";
334312
case MASTERNODE_NEW_START_REQUIRED: return "NEW_START_REQUIRED";
335313
case MASTERNODE_POSE_BAN: return "POSE_BAN";
336314
default: return "UNKNOWN";
@@ -599,7 +577,7 @@ bool CMasternodeBroadcast::CheckOutpoint(int& nDos)
599577
}
600578

601579
int nHeight;
602-
CollateralStatus err = CheckCollateral(vin.prevout, nHeight);
580+
CollateralStatus err = CheckCollateral(vin.prevout);
603581
if (err == COLLATERAL_UTXO_NOT_FOUND) {
604582
LogPrint(BCLog::MASTERNODE, "CMasternodeBroadcast::CheckOutpoint -- Failed to find Masternode UTXO, masternode=%s\n", vin.prevout.ToStringShort());
605583
return false;
@@ -609,7 +587,7 @@ bool CMasternodeBroadcast::CheckOutpoint(int& nDos)
609587
LogPrint(BCLog::MASTERNODE, "CMasternodeBroadcast::CheckOutpoint -- Masternode UTXO should have masternode collateral, masternode=%s\n", vin.prevout.ToStringShort());
610588
return false;
611589
}
612-
590+
// BTX ToDo
613591
if(chainActive.Height() - nHeight + 1 < Params().GetConsensus().nMasternodeMinimumConfirmations) {
614592
LogPrintf("CMasternodeBroadcast::CheckOutpoint -- Masternode UTXO must have at least %d confirmations, masternode=%s\n",
615593
Params().GetConsensus().nMasternodeMinimumConfirmations, vin.prevout.ToStringShort());
@@ -854,8 +832,8 @@ bool CMasternodePing::CheckAndUpdate(CMasternode* pmn, bool fFromNewBroadcast, i
854832

855833
// force update, ignoring cache
856834
pmn->Check(true);
857-
// relay ping for nodes in ENABLED/EXPIRED/WATCHDOG_EXPIRED state only, skip everyone else
858-
if (!pmn->IsEnabled() && !pmn->IsExpired() && !pmn->IsWatchdogExpired()) return false;
835+
// relay ping for nodes in ENABLED/EXPIRED state only, skip everyone else
836+
if (!pmn->IsEnabled() && !pmn->IsExpired()) return false;
859837

860838
LogPrint(BCLog::MASTERNODE, "CMasternodePing::CheckAndUpdate -- Masternode ping acceepted and relayed, masternode=%s\n", vin.prevout.ToStringShort());
861839
Relay(connman);

src/masternode.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ class CMasternode : public masternode_info_t
142142
MASTERNODE_EXPIRED,
143143
MASTERNODE_OUTPOINT_SPENT,
144144
MASTERNODE_UPDATE_REQUIRED,
145-
MASTERNODE_WATCHDOG_EXPIRED,
146145
MASTERNODE_NEW_START_REQUIRED,
147146
MASTERNODE_POSE_BAN
148147
};
@@ -205,7 +204,6 @@ class CMasternode : public masternode_info_t
205204
bool UpdateFromNewBroadcast(CMasternodeBroadcast& mnb, CConnman& connman);
206205

207206
static CollateralStatus CheckCollateral(const COutPoint& outpoint);
208-
static CollateralStatus CheckCollateral(const COutPoint& outpoint, int& nHeightRet);
209207

210208
// FXTC BEGIN
211209
bool CollateralValueCheck(int nHeight, CAmount TxValue);
@@ -234,27 +232,20 @@ class CMasternode : public masternode_info_t
234232
bool IsExpired() { return nActiveState == MASTERNODE_EXPIRED; }
235233
bool IsOutpointSpent() { return nActiveState == MASTERNODE_OUTPOINT_SPENT; }
236234
bool IsUpdateRequired() { return nActiveState == MASTERNODE_UPDATE_REQUIRED; }
237-
bool IsWatchdogExpired() { return nActiveState == MASTERNODE_WATCHDOG_EXPIRED; }
238235
bool IsNewStartRequired() { return nActiveState == MASTERNODE_NEW_START_REQUIRED; }
239236

240237
static bool IsValidStateForAutoStart(int nActiveStateIn)
241238
{
242239
return nActiveStateIn == MASTERNODE_ENABLED ||
243240
nActiveStateIn == MASTERNODE_PRE_ENABLED ||
244-
nActiveStateIn == MASTERNODE_EXPIRED ||
245-
nActiveStateIn == MASTERNODE_WATCHDOG_EXPIRED;
241+
nActiveStateIn == MASTERNODE_EXPIRED;
246242
}
247243

248244
bool IsValidForPayment()
249245
{
250246
if(nActiveState == MASTERNODE_ENABLED) {
251247
return true;
252248
}
253-
if(!sporkManager.IsSporkActive(SPORK_14_REQUIRE_SENTINEL_FLAG) &&
254-
(nActiveState == MASTERNODE_WATCHDOG_EXPIRED)) {
255-
return true;
256-
}
257-
258249
return false;
259250
}
260251

src/masternodeconfig.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ bool CMasternodeConfig::read(std::string& strErr) {
5252
"#rpcpassword=mystrongpassword\n"
5353
"#rpcport=8556\n"
5454
"# Miscellaneous #\n"
55+
"nodebuglogfile=0\n"
5556
"daemon=1\n"
5657
"listen=1\n"
5758
"logtimestamps=1\n"

src/qt/bitcoingui.cpp

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -354,18 +354,12 @@ void BitcoinGUI::createActions()
354354
backupWalletAction = new QAction(platformStyle->TextColorIcon(":/icons/filesave"), tr("&Backup Wallet..."), this);
355355
backupWalletAction->setStatusTip(tr("Backup wallet to another location"));
356356
changePassphraseAction = new QAction(platformStyle->TextColorIcon(":/icons/key"), tr("&Change Passphrase..."), this);
357-
//Bitcore BEGINN
358357
unlockWalletAction = new QAction(platformStyle->TextColorIcon(":/icons/lock_open"), tr("&Unlock Wallet..."), this);
359358
unlockWalletAction->setStatusTip(tr("Unlock encrypted wallet for firther transactions."));
360-
//Bitcore END
361359
changePassphraseAction->setStatusTip(tr("Change the passphrase used for wallet encryption"));
360+
lockWalletAction = new QAction(tr("&Lock Wallet"), this);
361+
lockWalletAction = new QAction(platformStyle->TextColorIcon(":/icons/lock_closed"), tr("&Lock Wallet..."), this);
362362

363-
// Dash
364-
// FXTC TODO: menu items
365-
//-//unlockWalletAction = new QAction(tr("&Unlock Wallet..."), this);
366-
//-//unlockWalletAction->setToolTip(tr("Unlock wallet"));
367-
//-//lockWalletAction = new QAction(tr("&Lock Wallet"), this);
368-
//
369363

370364
// Megacoin
371365
//unlockWalletAction = new QAction(platformStyle->TextColorIcon(":/icons/lock_open"), tr("&Unlock Wallet..."), this);
@@ -497,7 +491,7 @@ void BitcoinGUI::createActions()
497491
// Dash
498492
// FXTC TODO: menu items
499493
connect(unlockWalletAction, SIGNAL(triggered()), walletFrame, SLOT(unlockWallet()));
500-
//connect(lockWalletAction, SIGNAL(triggered()), walletFrame, SLOT(lockWallet()));
494+
connect(lockWalletAction, SIGNAL(triggered()), walletFrame, SLOT(lockWallet()));
501495
//
502496

503497
connect(signMessageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized()));
@@ -565,7 +559,7 @@ void BitcoinGUI::createMenuBar()
565559
// Dash
566560
// FXTC TODO: menu items
567561
settings->addAction(unlockWalletAction);
568-
//-//settings->addAction(lockWalletAction);
562+
settings->addAction(lockWalletAction);
569563
//
570564

571565
// BitCore
@@ -1425,11 +1419,8 @@ void BitcoinGUI::setEncryptionStatus(int status)
14251419
labelWalletEncryptionIcon->hide();
14261420
encryptWalletAction->setChecked(false);
14271421
changePassphraseAction->setEnabled(false);
1428-
// Dash
1429-
// FXTC TODO: menu items
1430-
//unlockWalletAction->setEnabled(true);
1431-
//-//lockWalletAction->setVisible(false);
1432-
//
1422+
unlockWalletAction->setVisible(false);
1423+
lockWalletAction->setVisible(false);
14331424
encryptWalletAction->setEnabled(true);
14341425
break;
14351426
case WalletModel::Unlocked:
@@ -1438,14 +1429,13 @@ void BitcoinGUI::setEncryptionStatus(int status)
14381429
labelWalletEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>unlocked</b>"));
14391430
encryptWalletAction->setChecked(true);
14401431
changePassphraseAction->setEnabled(true);
1441-
// Dash
1442-
// FXTC TODO: menu items
1443-
unlockWalletAction->setEnabled(true);
1444-
//-//lockWalletAction->setVisible(true);
1445-
//
1432+
unlockWalletAction->setEnabled(false);
1433+
unlockWalletAction->setVisible(false);
1434+
lockWalletAction->setVisible(true);
14461435
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
14471436
break;
14481437
// Dash
1438+
/*
14491439
case WalletModel::UnlockedForMixingOnly:
14501440
labelWalletEncryptionIcon->show();
14511441
labelWalletEncryptionIcon->setPixmap(platformStyle->SingleColorIcon(":/icons/lock_open").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
@@ -1460,18 +1450,18 @@ void BitcoinGUI::setEncryptionStatus(int status)
14601450
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
14611451
break;
14621452
//
1453+
*/
14631454
case WalletModel::Locked:
14641455
labelWalletEncryptionIcon->show();
14651456
labelWalletEncryptionIcon->setPixmap(platformStyle->SingleColorIcon(":/icons/lock_closed").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
14661457
labelWalletEncryptionIcon->setToolTip(tr("Wallet is <b>encrypted</b> and currently <b>locked</b>"));
14671458
encryptWalletAction->setChecked(true);
14681459
changePassphraseAction->setEnabled(true);
1469-
// Dash
1470-
// FXTC TODO: menu items
1460+
unlockWalletAction->setVisible(true);
14711461
unlockWalletAction->setEnabled(true);
1472-
//-//lockWalletAction->setVisible(false);
1473-
//
1474-
encryptWalletAction->setEnabled(false); // TODO: decrypt currently not supported
1462+
lockWalletAction->setVisible(false);
1463+
encryptWalletAction->setEnabled(false);
1464+
encryptWalletAction->setVisible(false);
14751465
break;
14761466
}
14771467
}

src/qt/bitcoingui.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ class BitcoinGUI : public QMainWindow
127127
QAction* changePassphraseAction = nullptr;
128128
// Dash
129129
QAction *unlockWalletAction = nullptr;
130+
QAction *lockWalletAction = nullptr;
130131
//
131132
QAction* aboutQtAction = nullptr;
132133
QAction* openRPCConsoleAction = nullptr;

src/qt/walletframe.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ void WalletFrame::unlockWallet()
204204
walletView->unlockWallet();
205205
}
206206

207+
void WalletFrame::lockWallet()
208+
{
209+
WalletView *walletView = currentWalletView();
210+
if (walletView)
211+
walletView->lockWallet();
212+
}
213+
207214
//Bitcore BEGIN
208215
void WalletFrame::unlockWalletAndKeepUnlocked()
209216
{

src/qt/walletframe.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public Q_SLOTS:
9393
void changePassphrase();
9494
/** Ask for passphrase to unlock wallet temporarily */
9595
void unlockWallet();
96+
void lockWallet();
9697
/** Ask for passphrase to unlock wallet till application closes */
9798
void unlockWalletAndKeepUnlocked();
9899

src/qt/walletview.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,10 @@ WalletView::WalletView(const PlatformStyle *_platformStyle, QWidget *parent):
100100

101101
WalletView::~WalletView()
102102
{
103+
/* This creates SIGSEGV, Segmentation fault Errors (mem=0x82a11aca2ac93867) at malloc.c:3103
103104
if(unlockContext)
104105
delete (WalletModel::UnlockContext*)(unlockContext);
106+
*/
105107
}
106108

107109
void WalletView::setBitcoinGUI(BitcoinGUI *gui)
@@ -331,12 +333,12 @@ void WalletView::unlockWallet(bool fForMixingOnly)
331333
return;
332334
// Unlock wallet when requested by wallet model
333335
// Dash
334-
//if (walletModel->getEncryptionStatus() == WalletModel::Locked)
335-
if (walletModel->getEncryptionStatus() == WalletModel::Locked || walletModel->getEncryptionStatus() == WalletModel::UnlockedForMixingOnly)
336+
//if (walletModel->getEncryptionStatus() == WalletModel::Locked || walletModel->getEncryptionStatus() == WalletModel::UnlockedForMixingOnly)
337+
if (walletModel->getEncryptionStatus() == WalletModel::Locked)
336338
{
337-
//AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this);
338-
AskPassphraseDialog dlg(fForMixingOnly ? AskPassphraseDialog::UnlockMixing : AskPassphraseDialog::Unlock, this);
339-
//
339+
AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this);
340+
//AskPassphraseDialog dlg(fForMixingOnly ? AskPassphraseDialog::UnlockMixing : AskPassphraseDialog::Unlock, this);
341+
340342
dlg.setModel(walletModel);
341343
dlg.exec();
342344
}

0 commit comments

Comments
 (0)