A bunch of mostly trivial tweaks/fixes (#2889)

* Trivial: vout->txout

* Re-use SetHexStr in few more places

* Tweak log output

* fix v13 release notes links

* Drop no longer used stuff

* Few more trivial fixes

* Adjust few rpc help strings

* Apply review suggestions
This commit is contained in:
UdjinM6 2019-04-30 15:48:21 +03:00 committed by GitHub
parent 1951001614
commit 8ffdcbf999
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 70 additions and 83 deletions

View File

@ -120,9 +120,9 @@ Dash Core tree 0.12.1.x was a fork of Bitcoin Core tree 0.12.
These release are considered obsolete. Old release notes can be found here:
- [v0.13.2.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.2.0.md) released Mar/15/2019
- [v0.13.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.1.0.md) released Feb/9/2019
- [v0.13.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.0.0.md) released Jan/14/2019
- [v0.13.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.2.md) released Mar/15/2019
- [v0.13.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.1.md) released Feb/9/2019
- [v0.13.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.0.md) released Jan/14/2019
- [v0.12.3.4](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.4.md) released Dec/14/2018
- [v0.12.3.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.3.md) released Sep/19/2018
- [v0.12.3.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.2.md) released Jul/09/2018

View File

@ -126,7 +126,7 @@ Dash Core tree 0.12.1.x was a fork of Bitcoin Core tree 0.12.
These release are considered obsolete. Old release notes can be found here:
- [v0.13.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.0.0.md) released Jan/14/2019
- [v0.13.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.0.md) released Jan/14/2019
- [v0.12.3.4](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.4.md) released Dec/14/2018
- [v0.12.3.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.3.md) released Sep/19/2018
- [v0.12.3.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.2.md) released Jul/09/2018

View File

@ -153,8 +153,8 @@ Dash Core tree 0.12.1.x was a fork of Bitcoin Core tree 0.12.
These release are considered obsolete. Old release notes can be found here:
- [v0.13.1.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.1.0.md) released Feb/9/2019
- [v0.13.0.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.0.0.md) released Jan/14/2019
- [v0.13.1](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.1.md) released Feb/9/2019
- [v0.13.0](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.13.0.md) released Jan/14/2019
- [v0.12.3.4](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.4.md) released Dec/14/2018
- [v0.12.3.3](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.3.md) released Sep/19/2018
- [v0.12.3.2](https://github.com/dashpay/dash/blob/master/doc/release-notes/dash/release-notes-0.12.3.2.md) released Jul/09/2018

View File

@ -1245,7 +1245,7 @@ class FullBlockTest(ComparisonTestFramework):
yield rejected()
# Test re-org of a week's worth of blocks (1088 blocks)
# Test re-org of a ~2 days' worth of blocks (1088 blocks)
# This test takes a minute or two and can be accomplished in memory
#
if self.options.runbarelyexpensive:

View File

@ -442,7 +442,7 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nStartTime = 1553126400; // Mar 21st, 2019
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nTimeout = 1584748800; // Mar 21st, 2020
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nThreshold = 50; // 80% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nThreshold = 50; // 50% of 100
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000000000003cd72a542"); // 4000
@ -601,7 +601,7 @@ public:
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nStartTime = 1553126400; // Mar 21st, 2019
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nTimeout = 1584748800; // Mar 21st, 2020
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nWindowSize = 100;
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nThreshold = 50; // 80% of 100
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0008].nThreshold = 50; // 50% of 100
// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000000000000000000");

View File

@ -60,7 +60,7 @@ void CDSNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, con
return;
llmq::quorumInstantSendManager->UpdatedBlockTip(pindexNew);
llmq::chainLocksHandler->UpdatedBlockTip(pindexNew, pindexFork);
llmq::chainLocksHandler->UpdatedBlockTip(pindexNew);
CPrivateSend::UpdatedBlockTip(pindexNew);
#ifdef ENABLE_WALLET
@ -68,8 +68,8 @@ void CDSNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, con
#endif // ENABLE_WALLET
instantsend.UpdatedBlockTip(pindexNew);
governance.UpdatedBlockTip(pindexNew, connman);
llmq::quorumManager->UpdatedBlockTip(pindexNew, pindexFork, fInitialDownload);
llmq::quorumDKGSessionManager->UpdatedBlockTip(pindexNew, pindexFork, fInitialDownload);
llmq::quorumManager->UpdatedBlockTip(pindexNew, fInitialDownload);
llmq::quorumDKGSessionManager->UpdatedBlockTip(pindexNew, fInitialDownload);
}
void CDSNotificationInterface::SyncTransaction(const CTransaction &tx, const CBlockIndex *pindex, int posInBlock)

View File

@ -36,7 +36,7 @@ uint256 CSimplifiedMNListEntry::CalcHash() const
std::string CSimplifiedMNListEntry::ToString() const
{
return strprintf("CSimplifiedMNListEntry(proRegTxHash=%s, confirmedHash=%s, service=%s, pubKeyOperator=%s, votingAddress=%s, isValie=%d)",
return strprintf("CSimplifiedMNListEntry(proRegTxHash=%s, confirmedHash=%s, service=%s, pubKeyOperator=%s, votingAddress=%s, isValid=%d)",
proRegTxHash.ToString(), confirmedHash.ToString(), service.ToString(false), pubKeyOperator.ToString(), CBitcoinAddress(keyIDVoting).ToString(), isValid);
}

View File

@ -495,14 +495,14 @@ bool CGovernanceObject::IsValidLocally(std::string& strError, bool& fMissingMast
std::string strOutpoint = masternodeOutpoint.ToStringShort();
auto dmn = mnList.GetMNByCollateral(masternodeOutpoint);
if (!dmn) {
strError = "Failed to find Masternode by UTXO, missing masternode=" + strOutpoint + "\n";
strError = "Failed to find Masternode by UTXO, missing masternode=" + strOutpoint;
return false;
}
if (!mnList.IsMNValid(dmn)) {
if (mnList.IsMNPoSeBanned(dmn)) {
strError = "Masternode is POSE_BANNED, masternode=" + strOutpoint + "\n";
strError = "Masternode is POSE_BANNED, masternode=" + strOutpoint;
} else {
strError = "Masternode is invalid for unknown reason, masternode=" + strOutpoint + "\n";
strError = "Masternode is invalid for unknown reason, masternode=" + strOutpoint;
}
return false;
}

View File

@ -183,7 +183,7 @@ void CGovernanceManager::ProcessMessage(CNode* pfrom, const std::string& strComm
if (fRateCheckBypassed && (fIsValid || fMasternodeMissing)) {
if (!MasternodeRateCheck(govobj, true)) {
LogPrintf("MNGOVERNANCEOBJECT -- masternode rate check failed (after signature verification) - %s - (current block height %d) \n", strHash, nCachedBlockHeight);
LogPrintf("MNGOVERNANCEOBJECT -- masternode rate check failed (after signature verification) - %s - (current block height %d)\n", strHash, nCachedBlockHeight);
return;
}
}
@ -445,7 +445,7 @@ void CGovernanceManager::UpdateCachesAndClean()
if (pObj->GetObjectType() == GOVERNANCE_OBJECT_PROPOSAL) {
CProposalValidator validator(pObj->GetDataAsHexString(), true);
if (!validator.Validate()) {
LogPrintf("CGovernanceManager::UpdateCachesAndClean -- set for deletion expired obj %s\n", (*it).first.ToString());
LogPrintf("CGovernanceManager::UpdateCachesAndClean -- set for deletion expired obj %s\n", strHash);
pObj->fCachedDelete = true;
if (pObj->nDeletionTime == 0) {
pObj->nDeletionTime = nNow;

View File

@ -801,7 +801,7 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
// scan for better chains in the block chain database, that are not yet connected in the active best chain
CValidationState state;
if (!ActivateBestChain(state, chainparams)) {
LogPrintf("Failed to connect best block");
LogPrintf("Failed to connect best block (%s)\n", FormatStateMessage(state));
StartShutdown();
}

View File

@ -159,7 +159,7 @@ CQuorumManager::CQuorumManager(CEvoDB& _evoDb, CBLSWorker& _blsWorker, CDKGSessi
{
}
void CQuorumManager::UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload)
void CQuorumManager::UpdatedBlockTip(const CBlockIndex* pindexNew, bool fInitialDownload)
{
if (fInitialDownload) {
return;

View File

@ -92,7 +92,7 @@ private:
public:
CQuorumManager(CEvoDB& _evoDb, CBLSWorker& _blsWorker, CDKGSessionManager& _dkgManager);
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);
void UpdatedBlockTip(const CBlockIndex *pindexNew, bool fInitialDownload);
bool HasQuorum(Consensus::LLMQType llmqType, const uint256& quorumHash);

View File

@ -434,7 +434,7 @@ std::vector<const CBlockIndex*> CQuorumBlockProcessor::GetMinedCommitmentsUntilB
auto quorumIndex = pindex->GetAncestor(quorumHeight);
assert(quorumIndex);
ret.emplace_back(pindex->GetAncestor(quorumHeight));
ret.emplace_back(quorumIndex);
dbIt->Next();
}

View File

@ -184,7 +184,7 @@ void CChainLocksHandler::AcceptedBlockHeader(const CBlockIndex* pindexNew)
}
}
void CChainLocksHandler::UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork)
void CChainLocksHandler::UpdatedBlockTip(const CBlockIndex* pindexNew)
{
// don't call TrySignChainTip directly but instead let the scheduler call it. This way we ensure that cs_main is
// never locked and TrySignChainTip is not called twice in parallel. Also avoids recursive calls due to
@ -301,7 +301,7 @@ void CChainLocksHandler::TrySignChainTip()
auto it = blockTxs.find(pindexWalk->GetBlockHash());
if (it == blockTxs.end()) {
// this should actually not happen as NewPoWValidBlock should have been called before
LogPrintf("CChainLocksHandler::%s -- blockTxs for %s not found\n", __func__,
LogPrint("chainlocks", "CChainLocksHandler::%s -- blockTxs for %s not found\n", __func__,
pindexWalk->GetBlockHash().ToString());
return;
}

View File

@ -88,7 +88,7 @@ public:
void ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, CConnman& connman);
void ProcessNewChainLock(NodeId from, const CChainLockSig& clsig, const uint256& hash);
void AcceptedBlockHeader(const CBlockIndex* pindexNew);
void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork);
void UpdatedBlockTip(const CBlockIndex* pindexNew);
void SyncTransaction(const CTransaction &tx, const CBlockIndex *pindex, int posInBlock);
void CheckActiveState();
void TrySignChainTip();

View File

@ -108,7 +108,7 @@ CDKGSessionHandler::~CDKGSessionHandler()
}
}
void CDKGSessionHandler::UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload)
void CDKGSessionHandler::UpdatedBlockTip(const CBlockIndex* pindexNew)
{
LOCK(cs);

View File

@ -121,7 +121,7 @@ public:
CDKGSessionHandler(const Consensus::LLMQParams& _params, ctpl::thread_pool& _messageHandlerPool, CBLSWorker& blsWorker, CDKGSessionManager& _dkgManager);
~CDKGSessionHandler();
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);
void UpdatedBlockTip(const CBlockIndex *pindexNew);
void ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, CConnman& connman);
private:

View File

@ -48,7 +48,7 @@ void CDKGSessionManager::StopMessageHandlerPool()
messageHandlerPool.stop(true);
}
void CDKGSessionManager::UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload)
void CDKGSessionManager::UpdatedBlockTip(const CBlockIndex* pindexNew, bool fInitialDownload)
{
const auto& consensus = Params().GetConsensus();
@ -62,7 +62,7 @@ void CDKGSessionManager::UpdatedBlockTip(const CBlockIndex* pindexNew, const CBl
return;
for (auto& qt : dkgSessionHandlers) {
qt.second.UpdatedBlockTip(pindexNew, pindexFork, fInitialDownload);
qt.second.UpdatedBlockTip(pindexNew);
}
}

View File

@ -53,7 +53,7 @@ public:
void StartMessageHandlerPool();
void StopMessageHandlerPool();
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);
void UpdatedBlockTip(const CBlockIndex *pindexNew, bool fInitialDownload);
void ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStream& vRecv, CConnman& connman);
bool AlreadyHave(const CInv& inv) const;

View File

@ -15,8 +15,6 @@ namespace llmq
// If true, we will connect to all new quorums and watch their communication
static const bool DEFAULT_WATCH_QUORUMS = false;
extern CDBWrapper* llmqDb;
// Init/destroy LLMQ globals
void InitLLMQSystem(CEvoDB& evoDb, CScheduler* scheduler, bool unitTests, bool fWipe = false);
void DestroyLLMQSystem();

View File

@ -1347,7 +1347,7 @@ void CSigSharesManager::WorkThreadMain()
int64_t lastSendTime = 0;
while (!workInterrupt) {
if (!quorumSigningManager || !g_connman || !quorumSigningManager) {
if (!quorumSigningManager || !g_connman) {
if (!workInterrupt.sleep_for(std::chrono::milliseconds(100))) {
return;
}

View File

@ -1156,7 +1156,7 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
// don't accept incoming connections until fully synced
if(fMasternodeMode && !masternodeSync.IsSynced()) {
LogPrintf("AcceptConnection -- masternode is not synced yet, skipping inbound connection attempt\n");
LogPrint("net", "AcceptConnection -- masternode is not synced yet, skipping inbound connection attempt\n");
CloseSocket(hSocket);
return;
}

View File

@ -864,13 +864,20 @@ bool CPrivateSendClientSession::DoAutomaticDenominating(CConnman& connman, bool
CAmount nBalanceDenominatedUnconf = pwalletMain->GetDenominatedBalance(true);
CAmount nBalanceDenominated = nBalanceDenominatedConf + nBalanceDenominatedUnconf;
LogPrint("privatesend", "CPrivateSendClientSession::DoAutomaticDenominating -- nValueMin: %f, nBalanceNeedsAnonymized: %f, nBalanceAnonimizableNonDenom: %f, nBalanceDenominatedConf: %f, nBalanceDenominatedUnconf: %f, nBalanceDenominated: %f\n",
(float)nValueMin / COIN,
(float)nBalanceNeedsAnonymized / COIN,
(float)nBalanceAnonimizableNonDenom / COIN,
(float)nBalanceDenominatedConf / COIN,
(float)nBalanceDenominatedUnconf / COIN,
(float)nBalanceDenominated / COIN);
LogPrint("privatesend", "CPrivateSendClientSession::DoAutomaticDenominating -- current stats:\n"
" nValueMin: %s\n"
" nBalanceNeedsAnonymized: %s\n"
" nBalanceAnonimizableNonDenom: %s\n"
" nBalanceDenominatedConf: %s\n"
" nBalanceDenominatedUnconf: %s\n"
" nBalanceDenominated: %s\n",
FormatMoney(nValueMin),
FormatMoney(nBalanceNeedsAnonymized),
FormatMoney(nBalanceAnonimizableNonDenom),
FormatMoney(nBalanceDenominatedConf),
FormatMoney(nBalanceDenominatedUnconf),
FormatMoney(nBalanceDenominated)
);
if (fDryRun) return true;

View File

@ -571,7 +571,7 @@ void OverviewPage::privateSendStatus()
QString s = tr("Last PrivateSend message:\n") + strStatus;
if(s != ui->labelPrivateSendLastMessage->text())
LogPrintf("OverviewPage::privateSendStatus -- Last PrivateSend message: %s\n", strStatus.toStdString());
LogPrint("privatesend", "OverviewPage::privateSendStatus -- Last PrivateSend message: %s\n", strStatus.toStdString());
ui->labelPrivateSendLastMessage->setText(s);

View File

@ -89,7 +89,7 @@ void TrafficGraphWidget::paintEvent(QPaintEvent *)
// decide what order of magnitude we are
int base = floor(log10(fMax));
float val = pow(10.0f, base);
float val2;
float val2 = val;
const QString units = tr("KB/s");
const float yMarginText = 2.0;

View File

@ -332,17 +332,17 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
{
{
strHTML += "<li>";
const CTxOut &vout = prev.out;
const CTxOut& txout = prev.out;
CTxDestination address;
if (ExtractDestination(vout.scriptPubKey, address))
if (ExtractDestination(txout.scriptPubKey, address))
{
if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].name.empty())
strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + " ";
strHTML += QString::fromStdString(CBitcoinAddress(address).ToString());
}
strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatHtmlWithUnit(unit, vout.nValue);
strHTML = strHTML + " IsMine=" + (wallet->IsMine(vout) & ISMINE_SPENDABLE ? tr("true") : tr("false"));
strHTML = strHTML + " IsWatchOnly=" + (wallet->IsMine(vout) & ISMINE_WATCH_ONLY ? tr("true") : tr("false")) + "</li>";
strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatHtmlWithUnit(unit, txout.nValue);
strHTML = strHTML + " IsMine=" + (wallet->IsMine(txout) & ISMINE_SPENDABLE ? tr("true") : tr("false"));
strHTML = strHTML + " IsWatchOnly=" + (wallet->IsMine(txout) & ISMINE_WATCH_ONLY ? tr("true") : tr("false")) + "</li>";
}
}
}

View File

@ -329,7 +329,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx, int numISLocks, int c
if (wtx.isAbandoned())
status.status = TransactionStatus::Abandoned;
}
else if (!wtx.IsChainLocked() && status.depth < RecommendedNumConfirmations)
else if (status.depth < RecommendedNumConfirmations && !wtx.IsChainLocked())
{
status.status = TransactionStatus::Confirming;
}

View File

@ -423,6 +423,8 @@ void TransactionView::exportClicked()
void TransactionView::contextualMenu(const QPoint &point)
{
if (!transactionView || !transactionView->selectionModel())
return;
QModelIndex index = transactionView->indexAt(point);
QModelIndexList selection = transactionView->selectionModel()->selectedRows(0);
if (selection.empty())

View File

@ -562,7 +562,7 @@ UniValue gobject_vote_many(const JSONRPCRequest& request)
void gobject_vote_alias_help(CWallet* const pwallet)
{
throw std::runtime_error(
"gobject vote-alias <governance-hash> <vote> <vote-outcome> <alias-name>\n"
"gobject vote-alias <governance-hash> <vote> <vote-outcome> <protx-hash>\n"
"Vote on a governance object by masternode's voting key (if present in local wallet)\n"
+ HelpRequiringPassphrase(pwallet) + "\n"
"\nArguments:\n"
@ -887,7 +887,7 @@ UniValue gobject_getcurrentvotes(const JSONRPCRequest& request)
" list - List governance objects (can be filtered by signal and/or object type)\n"
" diff - List differences since last diff\n"
#ifdef ENABLE_WALLET
" vote-alias - Vote on a governance object by masternode alias/proTxHash\n"
" vote-alias - Vote on a governance object by masternode proTxHash\n"
#endif // ENABLE_WALLET
" vote-conf - Vote on a governance object by masternode configured in dash.conf\n"
#ifdef ENABLE_WALLET

View File

@ -140,21 +140,17 @@ static CKeyID ParsePubKeyIDFromAddress(const std::string& strAddress, const std:
static CBLSPublicKey ParseBLSPubKey(const std::string& hexKey, const std::string& paramName)
{
auto binKey = ParseHex(hexKey);
CBLSPublicKey pubKey;
pubKey.SetBuf(binKey);
if (!pubKey.IsValid()) {
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%s must be a valid BLS address, not %s", paramName, hexKey));
if (!pubKey.SetHexStr(hexKey)) {
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%s must be a valid BLS public key, not %s", paramName, hexKey));
}
return pubKey;
}
static CBLSSecretKey ParseBLSSecretKey(const std::string& hexKey, const std::string& paramName)
{
auto binKey = ParseHex(hexKey);
CBLSSecretKey secKey;
secKey.SetBuf(binKey);
if (!secKey.IsValid()) {
if (!secKey.SetHexStr(hexKey)) {
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%s must be a valid BLS secret key", paramName));
}
return secKey;

View File

@ -136,6 +136,8 @@ void quorum_dkgstatus_help()
{
throw std::runtime_error(
"quorum dkgstatus (\"proTxHash\" detail_level)\n"
"Return the status of the current DKG process.\n"
"Works only when SPORK_17_QUORUM_DKG_ENABLED and SPORK_18_QUORUM_DEBUG_ENABLED sporks are ON.\n"
"\nArguments:\n"
"1. \"proTxHash\" (string, optional, default=\"\") ProTxHash of masternode to show status for.\n"
" If set to an empty string, the local status is shown.\n"

View File

@ -138,13 +138,11 @@ void CSporkManager::ProcessSpork(CNode* pfrom, const std::string& strCommand, CD
CKeyID keyIDSigner;
bool fSpork6IsActive = IsSporkActive(SPORK_6_NEW_SIGS);
if (!spork.GetSignerKeyID(keyIDSigner, fSpork6IsActive)
|| !setSporkPubKeyIDs.count(keyIDSigner)) {
if (!spork.GetSignerKeyID(keyIDSigner, fSpork6IsActive) || !setSporkPubKeyIDs.count(keyIDSigner)) {
// Note: unlike for other messages we have to check for new format even with SPORK_6_NEW_SIGS
// inactive because SPORK_6_NEW_SIGS default is OFF and it is not the first spork to sync
// (and even if it would, spork order can't be guaranteed anyway).
if (!spork.GetSignerKeyID(keyIDSigner, !fSpork6IsActive)
|| !setSporkPubKeyIDs.count(keyIDSigner)) {
if (!spork.GetSignerKeyID(keyIDSigner, !fSpork6IsActive) || !setSporkPubKeyIDs.count(keyIDSigner)) {
LOCK(cs_main);
LogPrintf("CSporkManager::ProcessSpork -- ERROR: invalid signature\n");
Misbehaving(pfrom->GetId(), 100);

View File

@ -890,6 +890,7 @@ void RenameThread(const char* name)
// Prevent warnings for unused parameters...
(void)name;
#endif
LogPrintf("%s: thread new name %s\n", __func__, name);
}
std::string GetThreadName()

View File

@ -91,18 +91,3 @@ std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime)
ss << boost::posix_time::from_time_t(nTime);
return ss.str();
}
std::string DurationToDHMS(int64_t nDurationTime)
{
int seconds = nDurationTime % 60;
nDurationTime /= 60;
int minutes = nDurationTime % 60;
nDurationTime /= 60;
int hours = nDurationTime % 24;
int days = nDurationTime / 24;
if(days)
return strprintf("%dd %02dh:%02dm:%02ds", days, hours, minutes, seconds);
if(hours)
return strprintf("%02dh:%02dm:%02ds", hours, minutes, seconds);
return strprintf("%02dm:%02ds", minutes, seconds);
}

View File

@ -29,6 +29,5 @@ bool IsMockTime();
void MilliSleep(int64_t n);
std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime);
std::string DurationToDHMS(int64_t nDurationTime);
#endif // BITCOIN_UTILTIME_H

View File

@ -56,7 +56,6 @@
#include <boost/algorithm/string/join.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/math/distributions/poisson.hpp>
#include <boost/thread.hpp>
@ -2491,14 +2490,14 @@ void static UpdateTip(CBlockIndex *pindexNew, const CChainParams& chainParams) {
}
}
}
LogPrintf("%s: new best=%s height=%d version=0x%08x log2_work=%.8f tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)", __func__,
std::string strMessage = strprintf("%s: new best=%s height=%d version=0x%08x log2_work=%.8f tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)", __func__,
chainActive.Tip()->GetBlockHash().ToString(), chainActive.Height(), chainActive.Tip()->nVersion,
log(chainActive.Tip()->nChainWork.getdouble())/log(2.0), (unsigned long)chainActive.Tip()->nChainTx,
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", chainActive.Tip()->GetBlockTime()),
GuessVerificationProgress(chainParams.TxData(), chainActive.Tip()), pcoinsTip->DynamicMemoryUsage() * (1.0 / (1<<20)), pcoinsTip->GetCacheSize());
if (!warningMessages.empty())
LogPrintf(" warning='%s'", boost::algorithm::join(warningMessages, ", "));
LogPrintf("\n");
strMessage += strprintf(" warning='%s'", boost::algorithm::join(warningMessages, ", "));
LogPrintf("%s\n", strMessage);
}
/** Disconnect chainActive's tip. You probably want to call mempool.removeForReorg and manually re-limit mempool size after this, with cs_main held. */
@ -2603,7 +2602,7 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
if (!rv) {
if (state.IsInvalid())
InvalidBlockFound(pindexNew, state);
return error("ConnectTip(): ConnectBlock %s failed", pindexNew->GetBlockHash().ToString());
return error("ConnectTip(): ConnectBlock %s failed with %s", pindexNew->GetBlockHash().ToString(), FormatStateMessage(state));
}
nTime3 = GetTimeMicros(); nTimeConnectTotal += nTime3 - nTime2;
LogPrint("bench", " - Connect total: %.2fms [%.2fs]\n", (nTime3 - nTime2) * 0.001, nTimeConnectTotal * 0.000001);