diff --git a/src/miner.cpp b/src/miner.cpp index 46cde91a4d..2c5cba742c 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -411,7 +411,7 @@ static bool ProcessBlockFound(CBlock* pblock, const CChainParams& chainparams) } // Inform about the new block - GetMainSignals().BlockFound(*pblock); + GetMainSignals().BlockFound(pblock->GetHash()); // Process this block the same as if we had received it from another node CValidationState state; diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp index 96f2779150..d365f03008 100644 --- a/src/validationinterface.cpp +++ b/src/validationinterface.cpp @@ -20,11 +20,11 @@ void RegisterValidationInterface(CValidationInterface* pwalletIn) { g_signals.Broadcast.connect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, _1)); g_signals.BlockChecked.connect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2)); g_signals.ScriptForMining.connect(boost::bind(&CValidationInterface::GetScriptForMining, pwalletIn, _1)); - g_signals.BlockFound.connect(boost::bind(&CValidationInterface::UpdateRequestCount, pwalletIn, _1)); + g_signals.BlockFound.connect(boost::bind(&CValidationInterface::ResetRequestCount, pwalletIn, _1)); } void UnregisterValidationInterface(CValidationInterface* pwalletIn) { - g_signals.BlockFound.disconnect(boost::bind(&CValidationInterface::UpdateRequestCount, pwalletIn, _1)); + g_signals.BlockFound.disconnect(boost::bind(&CValidationInterface::ResetRequestCount, pwalletIn, _1)); g_signals.ScriptForMining.disconnect(boost::bind(&CValidationInterface::GetScriptForMining, pwalletIn, _1)); g_signals.BlockChecked.disconnect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2)); g_signals.Broadcast.disconnect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, _1)); diff --git a/src/validationinterface.h b/src/validationinterface.h index 34acd40165..fb0ce0bdaa 100644 --- a/src/validationinterface.h +++ b/src/validationinterface.h @@ -37,7 +37,7 @@ protected: virtual void ResendWalletTransactions(int64_t nBestBlockTime) {} virtual void BlockChecked(const CBlock&, const CValidationState&) {} virtual void GetScriptForMining(boost::shared_ptr&) {}; - virtual void UpdateRequestCount(const CBlock&) {}; + virtual void ResetRequestCount(const uint256 &hash) {}; friend void ::RegisterValidationInterface(CValidationInterface*); friend void ::UnregisterValidationInterface(CValidationInterface*); friend void ::UnregisterAllValidationInterfaces(); @@ -59,7 +59,7 @@ struct CMainSignals { /** Notifies listeners that a key for mining is required (coinbase) */ boost::signals2::signal&)> ScriptForMining; /** Notifies listeners that a block has been successfully mined */ - boost::signals2::signal BlockFound; + boost::signals2::signal BlockFound; }; CMainSignals& GetMainSignals(); diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h index 1774596af1..f36c98e9fc 100644 --- a/src/wallet/wallet.h +++ b/src/wallet/wallet.h @@ -683,10 +683,10 @@ public: } void GetScriptForMining(boost::shared_ptr &script); - void UpdateRequestCount(const CBlock& block) + void ResetRequestCount(const uint256 &hash) { LOCK(cs_wallet); - mapRequestCount[block.GetHash()] = 0; + mapRequestCount[hash] = 0; }; unsigned int GetKeyPoolSize()