From bb90eb4bf022ad82547aa6de05dca3d729a6a241 Mon Sep 17 00:00:00 2001 From: Pasta Date: Sat, 16 Feb 2019 15:09:51 -0600 Subject: [PATCH] backports-0.15-pr6 code review --- qa/rpc-tests/p2p-acceptblock.py | 3 ++- src/init.cpp | 14 +++++++------- src/llmq/quorums_debug.cpp | 2 +- src/txmempool.cpp | 7 ------- src/txmempool.h | 1 - src/wallet/walletdb.cpp | 2 +- 6 files changed, 11 insertions(+), 18 deletions(-) diff --git a/qa/rpc-tests/p2p-acceptblock.py b/qa/rpc-tests/p2p-acceptblock.py index aac99856b..55e65ce43 100644 --- a/qa/rpc-tests/p2p-acceptblock.py +++ b/qa/rpc-tests/p2p-acceptblock.py @@ -221,7 +221,8 @@ class AcceptBlockTest(BitcoinTestFramework): headers_message.headers.append(CBlockHeader(next_block)) tips[j] = next_block - time.sleep(2) + set_mocktime(get_mocktime() + 2) + set_node_times(self.nodes, get_mocktime()) # Blocks 1-287 should be accepted, block 288 should be ignored because it's too far ahead for x in all_blocks[:-1]: self.nodes[0].getblock(x.hash) diff --git a/src/init.cpp b/src/init.cpp index c7dfbb740..c50f4befd 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -2032,19 +2032,19 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler) // ********************************************************* Step 11c: schedule Dash-specific tasks if (!fLiteMode) { - scheduler.scheduleEvery(boost::bind(&CNetFulfilledRequestManager::DoMaintenance, boost::ref(netfulfilledman)), 60); - scheduler.scheduleEvery(boost::bind(&CMasternodeSync::DoMaintenance, boost::ref(masternodeSync), boost::ref(*g_connman)), 1); - scheduler.scheduleEvery(boost::bind(&CMasternodeUtils::DoMaintenance, boost::ref(*g_connman)), 1); + scheduler.scheduleEvery(boost::bind(&CNetFulfilledRequestManager::DoMaintenance, boost::ref(netfulfilledman)), 60 * 1000); + scheduler.scheduleEvery(boost::bind(&CMasternodeSync::DoMaintenance, boost::ref(masternodeSync), boost::ref(*g_connman)), 1 * 1000); + scheduler.scheduleEvery(boost::bind(&CMasternodeUtils::DoMaintenance, boost::ref(*g_connman)), 1 * 1000); - scheduler.scheduleEvery(boost::bind(&CGovernanceManager::DoMaintenance, boost::ref(governance), boost::ref(*g_connman)), 60 * 5); + scheduler.scheduleEvery(boost::bind(&CGovernanceManager::DoMaintenance, boost::ref(governance), boost::ref(*g_connman)), 60 * 5 * 1000); - scheduler.scheduleEvery(boost::bind(&CInstantSend::DoMaintenance, boost::ref(instantsend)), 60); + scheduler.scheduleEvery(boost::bind(&CInstantSend::DoMaintenance, boost::ref(instantsend)), 60 * 1000); if (fMasternodeMode) - scheduler.scheduleEvery(boost::bind(&CPrivateSendServer::DoMaintenance, boost::ref(privateSendServer), boost::ref(*g_connman)), 1); + scheduler.scheduleEvery(boost::bind(&CPrivateSendServer::DoMaintenance, boost::ref(privateSendServer), boost::ref(*g_connman)), 1 * 1000); #ifdef ENABLE_WALLET else - scheduler.scheduleEvery(boost::bind(&CPrivateSendClientManager::DoMaintenance, boost::ref(privateSendClient), boost::ref(*g_connman)), 1); + scheduler.scheduleEvery(boost::bind(&CPrivateSendClientManager::DoMaintenance, boost::ref(privateSendClient), boost::ref(*g_connman)), 1 * 1000); #endif // ENABLE_WALLET } diff --git a/src/llmq/quorums_debug.cpp b/src/llmq/quorums_debug.cpp index 6237b2721..93775325d 100644 --- a/src/llmq/quorums_debug.cpp +++ b/src/llmq/quorums_debug.cpp @@ -114,7 +114,7 @@ CDKGDebugManager::CDKGDebugManager(CScheduler* _scheduler) : if (scheduler) { scheduler->scheduleEvery([&]() { SendLocalStatus(); - }, 10); + }, 10 * 1000); } } diff --git a/src/txmempool.cpp b/src/txmempool.cpp index d243b44bf..3e5872ad4 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -1580,13 +1580,6 @@ CFeeRate CTxMemPool::GetMinFee(size_t sizelimit) const { return std::max(CFeeRate(rollingMinimumFeeRate), incrementalRelayFee); } -void CTxMemPool::UpdateMinFee(const CFeeRate& _minReasonableRelayFee) -{ - LOCK(cs); - delete minerPolicyEstimator; - minerPolicyEstimator = new CBlockPolicyEstimator(_minReasonableRelayFee); -} - void CTxMemPool::trackPackageRemoved(const CFeeRate& rate) { AssertLockHeld(cs); if (rate.GetFeePerK() > rollingMinimumFeeRate) { diff --git a/src/txmempool.h b/src/txmempool.h index db399b9a4..9893ccdcf 100644 --- a/src/txmempool.h +++ b/src/txmempool.h @@ -656,7 +656,6 @@ public: * would otherwise be half of this, it is set to 0 instead. */ CFeeRate GetMinFee(size_t sizelimit) const; - void UpdateMinFee(const CFeeRate& _minReasonableRelayFee); /** Remove transactions from the mempool until its dynamic size is <= sizelimit. * pvNoSpendsRemaining, if set, will be populated with the list of outpoints diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index 35b86f095..3714a51f7 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -864,7 +864,7 @@ bool CWalletDB::RecoverKeysOnlyFilter(void *callbackData, CDataStream ssKey, CDa fReadOK = ReadKeyValue(dummyWallet, ssKey, ssValue, dummyWss, strType, strErr); } - if (!IsKeyType(strType) && strType != "hdchain") + if (!IsKeyType(strType) && strType != "hdpubkey") return false; if (!fReadOK) {