Remove `ResetRequestCount`
There is no longer any `mapRequestCount` to reset. This also removes the `BlockFound` signal, as its only purpose was to call `ResetRequestCount`.
This commit is contained in:
parent
aa88e23f6b
commit
2c48eddfa5
|
@ -877,9 +877,6 @@ static bool ProcessBlockFound(const CBlock* pblock, const CChainParams& chainpar
|
||||||
return error("ZcashMiner: generated block is stale");
|
return error("ZcashMiner: generated block is stale");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inform about the new block
|
|
||||||
GetMainSignals().BlockFound(pblock->GetHash());
|
|
||||||
|
|
||||||
// Process this block the same as if we had received it from another node
|
// Process this block the same as if we had received it from another node
|
||||||
CValidationState state;
|
CValidationState state;
|
||||||
if (!ProcessNewBlock(state, chainparams, NULL, pblock, true, NULL))
|
if (!ProcessNewBlock(state, chainparams, NULL, pblock, true, NULL))
|
||||||
|
|
|
@ -40,11 +40,9 @@ void RegisterValidationInterface(CValidationInterface* pwalletIn) {
|
||||||
g_signals.Broadcast.connect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, _1));
|
g_signals.Broadcast.connect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, _1));
|
||||||
g_signals.BlockChecked.connect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2));
|
g_signals.BlockChecked.connect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2));
|
||||||
g_signals.AddressForMining.connect(boost::bind(&CValidationInterface::GetAddressForMining, pwalletIn, _1));
|
g_signals.AddressForMining.connect(boost::bind(&CValidationInterface::GetAddressForMining, pwalletIn, _1));
|
||||||
g_signals.BlockFound.connect(boost::bind(&CValidationInterface::ResetRequestCount, pwalletIn, _1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnregisterValidationInterface(CValidationInterface* pwalletIn) {
|
void UnregisterValidationInterface(CValidationInterface* pwalletIn) {
|
||||||
g_signals.BlockFound.disconnect(boost::bind(&CValidationInterface::ResetRequestCount, pwalletIn, _1));
|
|
||||||
g_signals.AddressForMining.disconnect(boost::bind(&CValidationInterface::GetAddressForMining, pwalletIn, _1));
|
g_signals.AddressForMining.disconnect(boost::bind(&CValidationInterface::GetAddressForMining, pwalletIn, _1));
|
||||||
g_signals.BlockChecked.disconnect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2));
|
g_signals.BlockChecked.disconnect(boost::bind(&CValidationInterface::BlockChecked, pwalletIn, _1, _2));
|
||||||
g_signals.Broadcast.disconnect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, _1));
|
g_signals.Broadcast.disconnect(boost::bind(&CValidationInterface::ResendWalletTransactions, pwalletIn, _1));
|
||||||
|
@ -57,7 +55,6 @@ void UnregisterValidationInterface(CValidationInterface* pwalletIn) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UnregisterAllValidationInterfaces() {
|
void UnregisterAllValidationInterfaces() {
|
||||||
g_signals.BlockFound.disconnect_all_slots();
|
|
||||||
g_signals.AddressForMining.disconnect_all_slots();
|
g_signals.AddressForMining.disconnect_all_slots();
|
||||||
g_signals.BlockChecked.disconnect_all_slots();
|
g_signals.BlockChecked.disconnect_all_slots();
|
||||||
g_signals.Broadcast.disconnect_all_slots();
|
g_signals.Broadcast.disconnect_all_slots();
|
||||||
|
|
|
@ -95,7 +95,6 @@ protected:
|
||||||
virtual void ResendWalletTransactions(int64_t nBestBlockTime) {}
|
virtual void ResendWalletTransactions(int64_t nBestBlockTime) {}
|
||||||
virtual void BlockChecked(const CBlock&, const CValidationState&) {}
|
virtual void BlockChecked(const CBlock&, const CValidationState&) {}
|
||||||
virtual void GetAddressForMining(std::optional<MinerAddress>&) {};
|
virtual void GetAddressForMining(std::optional<MinerAddress>&) {};
|
||||||
virtual void ResetRequestCount(const uint256 &hash) {};
|
|
||||||
friend void ::RegisterValidationInterface(CValidationInterface*);
|
friend void ::RegisterValidationInterface(CValidationInterface*);
|
||||||
friend void ::UnregisterValidationInterface(CValidationInterface*);
|
friend void ::UnregisterValidationInterface(CValidationInterface*);
|
||||||
friend void ::UnregisterAllValidationInterfaces();
|
friend void ::UnregisterAllValidationInterfaces();
|
||||||
|
@ -165,8 +164,6 @@ struct CMainSignals {
|
||||||
boost::signals2::signal<void (const CBlock&, const CValidationState&)> BlockChecked;
|
boost::signals2::signal<void (const CBlock&, const CValidationState&)> BlockChecked;
|
||||||
/** Notifies listeners that an address for mining is required (coinbase) */
|
/** Notifies listeners that an address for mining is required (coinbase) */
|
||||||
boost::signals2::signal<void (std::optional<MinerAddress>&)> AddressForMining;
|
boost::signals2::signal<void (std::optional<MinerAddress>&)> AddressForMining;
|
||||||
/** Notifies listeners that a block has been successfully mined */
|
|
||||||
boost::signals2::signal<void (const uint256 &)> BlockFound;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CMainSignals& GetMainSignals();
|
CMainSignals& GetMainSignals();
|
||||||
|
|
|
@ -1970,11 +1970,6 @@ public:
|
||||||
void UpdatedTransaction(const uint256 &hashTx);
|
void UpdatedTransaction(const uint256 &hashTx);
|
||||||
|
|
||||||
void GetAddressForMining(std::optional<MinerAddress> &minerAddress);
|
void GetAddressForMining(std::optional<MinerAddress> &minerAddress);
|
||||||
void ResetRequestCount(const uint256 &hash)
|
|
||||||
{
|
|
||||||
LOCK(cs_wallet);
|
|
||||||
mapRequestCount[hash] = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
unsigned int GetKeyPoolSize()
|
unsigned int GetKeyPoolSize()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue