make CheckDSTXes() private, execute it on both client and server (#1736)
This commit is contained in:
parent
c5ec2f82a8
commit
f4502099a4
@ -65,6 +65,7 @@ void CDSNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, con
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
mnodeman.UpdatedBlockTip(pindexNew);
|
mnodeman.UpdatedBlockTip(pindexNew);
|
||||||
|
CPrivateSend::UpdatedBlockTip(pindexNew);
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
privateSendClient.UpdatedBlockTip(pindexNew);
|
privateSendClient.UpdatedBlockTip(pindexNew);
|
||||||
#endif // ENABLE_WALLET
|
#endif // ENABLE_WALLET
|
||||||
|
@ -1391,13 +1391,13 @@ void CPrivateSendClient::UpdatedBlockTip(const CBlockIndex *pindex)
|
|||||||
nCachedBlockHeight = pindex->nHeight;
|
nCachedBlockHeight = pindex->nHeight;
|
||||||
LogPrint("privatesend", "CPrivateSendClient::UpdatedBlockTip -- nCachedBlockHeight: %d\n", nCachedBlockHeight);
|
LogPrint("privatesend", "CPrivateSendClient::UpdatedBlockTip -- nCachedBlockHeight: %d\n", nCachedBlockHeight);
|
||||||
|
|
||||||
CPrivateSend::CheckDSTXes(pindex->nHeight);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Rename/move to core
|
//TODO: Rename/move to core
|
||||||
void ThreadCheckPrivateSendClient(CConnman& connman)
|
void ThreadCheckPrivateSendClient(CConnman& connman)
|
||||||
{
|
{
|
||||||
if(fLiteMode) return; // disable all Dash specific functionality
|
if(fLiteMode) return; // disable all Dash specific functionality
|
||||||
|
if(fMasterNode) return; // no client-side mixing on masternodes
|
||||||
|
|
||||||
static bool fOneThread;
|
static bool fOneThread;
|
||||||
if(fOneThread) return;
|
if(fOneThread) return;
|
||||||
|
@ -403,6 +403,13 @@ void CPrivateSend::CheckDSTXes(int nHeight)
|
|||||||
LogPrint("privatesend", "CPrivateSend::CheckDSTXes -- mapDSTX.size()=%llu\n", mapDSTX.size());
|
LogPrint("privatesend", "CPrivateSend::CheckDSTXes -- mapDSTX.size()=%llu\n", mapDSTX.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPrivateSend::UpdatedBlockTip(const CBlockIndex *pindex)
|
||||||
|
{
|
||||||
|
if(pindex && !fLiteMode && masternodeSync.IsMasternodeListSynced()) {
|
||||||
|
CheckDSTXes(pindex->nHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CPrivateSend::SyncTransaction(const CTransaction& tx, const CBlock* pblock)
|
void CPrivateSend::SyncTransaction(const CTransaction& tx, const CBlock* pblock)
|
||||||
{
|
{
|
||||||
if (tx.IsCoinBase()) return;
|
if (tx.IsCoinBase()) return;
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#ifndef PRIVATESEND_H
|
#ifndef PRIVATESEND_H
|
||||||
#define PRIVATESEND_H
|
#define PRIVATESEND_H
|
||||||
|
|
||||||
|
#include "chain.h"
|
||||||
#include "chainparams.h"
|
#include "chainparams.h"
|
||||||
#include "primitives/transaction.h"
|
#include "primitives/transaction.h"
|
||||||
#include "pubkey.h"
|
#include "pubkey.h"
|
||||||
@ -317,6 +318,8 @@ private:
|
|||||||
|
|
||||||
static CCriticalSection cs_mapdstx;
|
static CCriticalSection cs_mapdstx;
|
||||||
|
|
||||||
|
static void CheckDSTXes(int nHeight);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static void InitStandardDenominations();
|
static void InitStandardDenominations();
|
||||||
static std::vector<CAmount> GetStandardDenominations() { return vecStandardDenominations; }
|
static std::vector<CAmount> GetStandardDenominations() { return vecStandardDenominations; }
|
||||||
@ -348,8 +351,8 @@ public:
|
|||||||
|
|
||||||
static void AddDSTX(const CDarksendBroadcastTx& dstx);
|
static void AddDSTX(const CDarksendBroadcastTx& dstx);
|
||||||
static CDarksendBroadcastTx GetDSTX(const uint256& hash);
|
static CDarksendBroadcastTx GetDSTX(const uint256& hash);
|
||||||
static void CheckDSTXes(int nHeight);
|
|
||||||
|
|
||||||
|
static void UpdatedBlockTip(const CBlockIndex *pindex);
|
||||||
static void SyncTransaction(const CTransaction& tx, const CBlock* pblock);
|
static void SyncTransaction(const CTransaction& tx, const CBlock* pblock);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user