Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bloom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ bool CBloomFilter::CheckSpecialTransactionMatchesAndUpdate(const CTransaction &t
return false;
}

LogPrintf("Unknown special transaction type in Bloom filter check.");
LogPrintf("Unknown special transaction type in Bloom filter check.\n");
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ class CTestNetParams : public CChainParams {
consensus.fPowAllowMinDifficultyBlocks = true;
consensus.fPowNoRetargeting = false;
consensus.nPowKGWHeight = 4002; // nPowKGWHeight >= nPowDGWHeight means "no KGW"
consensus.nPowDGWHeight = 4002;
consensus.nPowDGWHeight = 4002; // TODO: make sure to drop all spork6 related code on next testnet reset
consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains
consensus.nMinerConfirmationWindow = 2016; // nPowTargetTimespan / nPowTargetSpacing
consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
Expand Down
2 changes: 1 addition & 1 deletion src/evo/specialtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ bool ProcessSpecialTxsInBlock(const CBlock& block, const CBlockIndex* pindex, CV
int64_t nTime5 = GetTimeMicros(); nTimeMerkle += nTime5 - nTime4;
LogPrint(BCLog::BENCHMARK, " - CheckCbTxMerkleRoots: %.2fms [%.2fs]\n", 0.001 * (nTime5 - nTime4), nTimeMerkle * 0.000001);
} catch (const std::exception& e) {
LogPrintf(strprintf("%s -- failed: %s\n", __func__, e.what()).c_str());
LogPrintf("%s -- failed: %s\n", __func__, e.what());
return state.DoS(100, false, REJECT_INVALID, "failed-procspectxsinblock");
}

Expand Down
2 changes: 1 addition & 1 deletion src/governance/governance-object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ std::set<uint256> CGovernanceObject::RemoveInvalidVotes(const COutPoint& mnOutpo
for (auto& h : removedVotes) {
removedStr += strprintf(" %s\n", h.ToString());
}
LogPrintf("CGovernanceObject::%s -- Removed %d invalid votes for %s from MN %s:\n%s", __func__, removedVotes.size(), nParentHash.ToString(), mnOutpoint.ToString(), removedStr);
LogPrintf("CGovernanceObject::%s -- Removed %d invalid votes for %s from MN %s:\n%s", __func__, removedVotes.size(), nParentHash.ToString(), mnOutpoint.ToString(), removedStr); /* Continued */
fDirtyCache = true;
}

Expand Down
19 changes: 6 additions & 13 deletions src/governance/governance-vote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ bool CGovernanceVote::Sign(const CKey& key, const CKeyID& keyID)
{
std::string strError;

if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) {
// Harden Spork6 so that it is active on testnet and no other networks
if (Params().NetworkIDString() == CBaseChainParams::TESTNET) {
uint256 hash = GetSignatureHash();

if (!CHashSigner::SignHash(hash, key, vchSig)) {
Expand Down Expand Up @@ -198,21 +199,13 @@ bool CGovernanceVote::CheckSignature(const CKeyID& keyID) const
{
std::string strError;

if (sporkManager.IsSporkActive(SPORK_6_NEW_SIGS)) {
// Harden Spork6 so that it is active on testnet and no other networks
if (Params().NetworkIDString() == CBaseChainParams::TESTNET) {
uint256 hash = GetSignatureHash();

if (!CHashSigner::VerifyHash(hash, keyID, vchSig, strError)) {
// could be a signature in old format
std::string strMessage = masternodeOutpoint.ToStringShort() + "|" + nParentHash.ToString() + "|" +
std::to_string(nVoteSignal) + "|" +
std::to_string(nVoteOutcome) + "|" +
std::to_string(nTime);

if (!CMessageSigner::VerifyMessage(keyID, vchSig, strMessage, strError)) {
// nope, not in old format either
LogPrint(BCLog::GOBJECT, "CGovernanceVote::IsValid -- VerifyMessage() failed, error: %s\n", strError);
return false;
}
LogPrint(BCLog::GOBJECT, "CGovernanceVote::IsValid -- VerifyHash() failed, error: %s\n", strError);
return false;
}
} else {
std::string strMessage = masternodeOutpoint.ToStringShort() + "|" + nParentHash.ToString() + "|" +
Expand Down
9 changes: 5 additions & 4 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -988,12 +988,13 @@ void InitParameterInteraction()
}
}

if (gArgs.GetArg("-prune", 0) > 0) {
int64_t nPruneArg = gArgs.GetArg("-prune", 0);
if (nPruneArg > 0) {
if (gArgs.SoftSetBoolArg("-disablegovernance", true)) {
LogPrintf("%s: parameter interaction: -prune=%d -> setting -disablegovernance=true\n", __func__);
LogPrintf("%s: parameter interaction: -prune=%d -> setting -disablegovernance=true\n", __func__, nPruneArg);
}
if (gArgs.SoftSetBoolArg("-txindex", false)) {
LogPrintf("%s: parameter interaction: -prune=%d -> setting -txindex=false\n", __func__);
LogPrintf("%s: parameter interaction: -prune=%d -> setting -txindex=false\n", __func__, nPruneArg);
}
}

Expand Down Expand Up @@ -1974,7 +1975,7 @@ bool AppInitMain()
if (!is_coinsview_empty) {
uiInterface.InitMessage(_("Verifying blocks..."));
if (fHavePruned && gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS) > MIN_BLOCKS_TO_KEEP) {
LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks",
LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks\n",
MIN_BLOCKS_TO_KEEP);
}

Expand Down
2 changes: 1 addition & 1 deletion src/llmq/quorums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ CQuorumCPtr CQuorumManager::GetQuorum(Consensus::LLMQType llmqType, const uint25
auto quorumIt = mapBlockIndex.find(quorumHash);

if (quorumIt == mapBlockIndex.end()) {
LogPrint(BCLog::LLMQ, "CQuorumManager::%s -- block %s not found", __func__, quorumHash.ToString());
LogPrint(BCLog::LLMQ, "CQuorumManager::%s -- block %s not found\n", __func__, quorumHash.ToString());
return nullptr;
}
pindexQuorum = quorumIt->second;
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/quorums_instantsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ void CInstantSendManager::HandleNewInstantSendLockRecoveredSig(const llmq::CReco
}

if (islock.txid != recoveredSig.msgHash) {
LogPrintf("CInstantSendManager::%s -- txid=%s: islock conflicts with %s, dropping own version", __func__,
LogPrintf("CInstantSendManager::%s -- txid=%s: islock conflicts with %s, dropping own version\n", __func__,
islock.txid.ToString(), recoveredSig.msgHash.ToString());
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/quorums_signing_shares.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ bool CSigSharesManager::ProcessPendingSigShares(CConnman& connman)
if (!pubKeyShare.IsValid()) {
// this should really not happen (we already ensured we have the quorum vvec,
// so we should also be able to create all pubkey shares)
LogPrintf("CSigSharesManager::%s -- pubKeyShare is invalid, which should not be possible here");
LogPrintf("CSigSharesManager::%s -- pubKeyShare is invalid, which should not be possible here\n", __func__);
assert(false);
}

Expand Down
6 changes: 3 additions & 3 deletions src/masternode/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ bool IsBlockValueValid(const CBlock& block, int nBlockHeight, CAmount blockRewar
// this actually also checks for correct payees and not only amount
if (!CSuperblockManager::IsValid(*block.vtx[0], nBlockHeight, blockReward)) {
// triggered but invalid? that's weird
LogPrintf("%s -- ERROR: Invalid superblock detected at height %d: %s", __func__, nBlockHeight, block.vtx[0]->ToString());
LogPrintf("%s -- ERROR: Invalid superblock detected at height %d: %s", __func__, nBlockHeight, block.vtx[0]->ToString()); /* Continued */
// should NOT allow invalid superblocks, when superblocks are enabled
strErrorRet = strprintf("invalid superblock detected at height %d", nBlockHeight);
return false;
Expand Down Expand Up @@ -189,7 +189,7 @@ bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight, CAmount bloc
LogPrint(BCLog::GOBJECT, "%s -- Valid superblock at height %d: %s", __func__, nBlockHeight, txNew.ToString());
// continue validation, should also pay MN
} else {
LogPrintf("%s -- ERROR: Invalid superblock detected at height %d: %s", __func__, nBlockHeight, txNew.ToString());
LogPrintf("%s -- ERROR: Invalid superblock detected at height %d: %s", __func__, nBlockHeight, txNew.ToString()); /* Continued */
// should NOT allow such superblocks, when superblocks are enabled
return false;
}
Expand All @@ -207,7 +207,7 @@ bool IsBlockPayeeValid(const CTransaction& txNew, int nBlockHeight, CAmount bloc
return true;
}

LogPrintf("%s -- ERROR: Invalid masternode payment detected at height %d: %s", __func__, nBlockHeight, txNew.ToString());
LogPrintf("%s -- ERROR: Invalid masternode payment detected at height %d: %s", __func__, nBlockHeight, txNew.ToString()); /* Continued */
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/net_processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2341,7 +2341,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
// Note: do not break the flow here

if (pfrom->fMasternodeProbe && !pfrom->fFirstMessageIsMNAUTH) {
LogPrint(BCLog::NET, "connection is a masternode probe but first received message is not MNAUTH, peer=%d", pfrom->GetId());
LogPrint(BCLog::NET, "connection is a masternode probe but first received message is not MNAUTH, peer=%d\n", pfrom->GetId());
pfrom->fDisconnect = true;
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/privatesend/privatesend-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ bool CPrivateSendClientSession::SignFinalTransaction(const CTransaction& finalTr
if (!fFound) {
// Something went wrong and we'll refuse to sign. It's possible we'll be charged collateral. But that's
// better than signing if the transaction doesn't look like what we wanted.
LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::%s -- an output is missing, refusing to sign! txout=%s\n", txout.ToString());
LogPrint(BCLog::PRIVATESEND, "CPrivateSendClientSession::%s -- an output is missing, refusing to sign! txout=%s\n", __func__, txout.ToString());
UnlockCoins();
keyHolderStorage.ReturnAll();
SetNull();
Expand Down
8 changes: 4 additions & 4 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ void BitcoinGUI::createActions()
sendCoinsMenuAction->setToolTip(sendCoinsMenuAction->statusTip());

privateSendCoinsAction = new QToolButton(this);
privateSendCoinsAction->setText(tr("&PrivateSend"));
privateSendCoinsAction->setText("&PrivateSend");
privateSendCoinsAction->setStatusTip(tr("PrivateSend coins to a Dash address"));
privateSendCoinsAction->setToolTip(privateSendCoinsAction->statusTip());
privateSendCoinsAction->setCheckable(true);
Expand Down Expand Up @@ -681,8 +681,8 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel)
connect(_clientModel, SIGNAL(networkActiveChanged(bool)), this, SLOT(setNetworkActive(bool)));

modalOverlay->setKnownBestHeight(_clientModel->getHeaderTipHeight(), QDateTime::fromTime_t(_clientModel->getHeaderTipTime()));
setNumBlocks(_clientModel->getNumBlocks(), _clientModel->getLastBlockDate(), _clientModel->getVerificationProgress(nullptr), false);
connect(_clientModel, SIGNAL(numBlocksChanged(int,QDateTime,double,bool)), this, SLOT(setNumBlocks(int,QDateTime,double,bool)));
setNumBlocks(_clientModel->getNumBlocks(), _clientModel->getLastBlockDate(), _clientModel->getLastBlockHash(), _clientModel->getVerificationProgress(nullptr), false);
connect(_clientModel, SIGNAL(numBlocksChanged(int,QDateTime,QString,double,bool)), this, SLOT(setNumBlocks(int,QDateTime,QString,double,bool)));

connect(_clientModel, SIGNAL(additionalDataSyncProgressChanged(double)), this, SLOT(setAdditionalDataSyncProgress(double)));

Expand Down Expand Up @@ -1031,7 +1031,7 @@ void BitcoinGUI::updateHeadersSyncProgressLabel()
progressBarLabel->setText(tr("Syncing Headers (%1%)...").arg(QString::number(100.0 / (headersTipHeight+estHeadersLeft)*headersTipHeight, 'f', 1)));
}

void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool header)
void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, const QString& blockHash, double nVerificationProgress, bool header)
{
#ifdef Q_OS_MAC
// Disabling macOS App Nap on initial sync, disk, reindex operations and mixing.
Expand Down
2 changes: 1 addition & 1 deletion src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public Q_SLOTS:
/** Get restart command-line parameters and request restart */
void handleRestart(QStringList args);
/** Set number of blocks and last block date shown in the UI */
void setNumBlocks(int count, const QDateTime& blockDate, double nVerificationProgress, bool headers);
void setNumBlocks(int count, const QDateTime& blockDate, const QString& blockHash, double nVerificationProgress, bool headers);
/** Set additional data sync status shown in the UI */
void setAdditionalDataSyncProgress(double nSyncProgress);

Expand Down
11 changes: 11 additions & 0 deletions src/qt/clientmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,16 @@ QDateTime ClientModel::getLastBlockDate() const
return QDateTime::fromTime_t(Params().GenesisBlock().GetBlockTime()); // Genesis block's time of current network
}

QString ClientModel::getLastBlockHash() const
{
LOCK(cs_main);

if (chainActive.Tip())
return QString::fromStdString(chainActive.Tip()->GetBlockHash().ToString());

return QString::fromStdString(Params().GenesisBlock().GetHash().ToString()); // Genesis block's hash of current network
}

long ClientModel::getMempoolSize() const
{
return mempool.size();
Expand Down Expand Up @@ -344,6 +354,7 @@ static void BlockTipChanged(ClientModel *clientmodel, bool initialSync, const CB
QMetaObject::invokeMethod(clientmodel, "numBlocksChanged", Qt::QueuedConnection,
Q_ARG(int, pIndex->nHeight),
Q_ARG(QDateTime, QDateTime::fromTime_t(pIndex->GetBlockTime())),
Q_ARG(QString, QString::fromStdString(pIndex->GetBlockHash().ToString())),
Q_ARG(double, clientmodel->getVerificationProgress(pIndex)),
Q_ARG(bool, fHeader));
nLastUpdateNotification = now;
Expand Down
3 changes: 2 additions & 1 deletion src/qt/clientmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class ClientModel : public QObject

double getVerificationProgress(const CBlockIndex *tip) const;
QDateTime getLastBlockDate() const;
QString getLastBlockHash() const;

//! Return true if core is doing initial block download
bool inInitialBlockDownload() const;
Expand Down Expand Up @@ -113,7 +114,7 @@ class ClientModel : public QObject
Q_SIGNALS:
void numConnectionsChanged(int count);
void masternodeListChanged() const;
void numBlocksChanged(int count, const QDateTime& blockDate, double nVerificationProgress, bool header);
void numBlocksChanged(int count, const QDateTime& blockDate, const QString& blockHash, double nVerificationProgress, bool header);
void additionalDataSyncProgressChanged(double nSyncProgress);
void mempoolSizeChanged(long count, size_t mempoolSizeInBytes);
void islockCountChanged(size_t count);
Expand Down
27 changes: 15 additions & 12 deletions src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

QList<CAmount> CoinControlDialog::payAmounts;
bool CoinControlDialog::fSubtractFeeFromAmount = false;
CoinControlDialog::Mode CoinControlDialog::mode{CoinControlDialog::Mode::NORMAL};

bool CCoinControlWidgetItem::operator<(const QTreeWidgetItem &other) const {
int column = treeWidget()->sortColumn();
Expand Down Expand Up @@ -514,16 +515,6 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
continue;
}

// unselect non-fully-mixed, this can happen when users switch from Send to PrivateSend
if (coinControl()->IsUsingPrivateSend()) {
int nRounds = model->getRealOutpointPrivateSendRounds(outpt);
if (nRounds < privateSendClient.nPrivateSendRounds) {
coinControl()->UnSelect(outpt);
fUnselectedNonMixed = true;
continue;
}
}

// Quantity
nQuantity++;

Expand Down Expand Up @@ -669,10 +660,22 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
}
}

void CoinControlDialog::usePrivateSend(bool fUsePrivateSend)
{
CoinControlDialog::mode = fUsePrivateSend ? CoinControlDialog::Mode::PRIVATESEND : CoinControlDialog::Mode::NORMAL;
}

CCoinControl* CoinControlDialog::coinControl()
{
static CCoinControl coin_control;
return &coin_control;
if (CoinControlDialog::mode == CoinControlDialog::Mode::NORMAL) {
static CCoinControl coinControlNormal;
coinControlNormal.UsePrivateSend(false);
return &coinControlNormal;
} else {
static CCoinControl coinControlPrivateSend;
coinControlPrivateSend.UsePrivateSend(true);
return &coinControlPrivateSend;
}
}

void CoinControlDialog::updateView()
Expand Down
8 changes: 8 additions & 0 deletions src/qt/coincontroldialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class CoinControlDialog : public QDialog
static QList<CAmount> payAmounts;
static CCoinControl *coinControl();
static bool fSubtractFeeFromAmount;
static void usePrivateSend(bool fUsePrivateSend);

private:
Ui::CoinControlDialog *ui;
Expand Down Expand Up @@ -83,6 +84,13 @@ class CoinControlDialog : public QDialog
};
friend class CCoinControlWidgetItem;

enum class Mode {
NORMAL,
PRIVATESEND,
};

static CoinControlDialog::Mode mode;

private Q_SLOTS:
void showMenu(const QPoint &);
void copyAmount();
Expand Down
Loading