dash/src/dsnotificationinterface.cpp

45 lines
1.5 KiB
C++
Raw Normal View History

2016-12-20 14:26:45 +01:00
// Copyright (c) 2014-2017 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "dsnotificationinterface.h"
#include "instantx.h"
2016-04-15 04:54:11 +02:00
#include "governance.h"
2016-10-20 23:11:30 +02:00
#include "masternodeman.h"
#include "masternode-payments.h"
#include "masternode-sync.h"
#include "privatesend-client.h"
void CDSNotificationInterface::InitializeCurrentBlockTip()
{
LOCK(cs_main);
UpdatedBlockTip(chainActive.Tip(), NULL, IsInitialBlockDownload());
}
void CDSNotificationInterface::AcceptedBlockHeader(const CBlockIndex *pindexNew)
{
masternodeSync.AcceptedBlockHeader(pindexNew);
}
void CDSNotificationInterface::NotifyHeaderTip(const CBlockIndex *pindexNew, bool fInitialDownload)
{
masternodeSync.NotifyHeaderTip(pindexNew, fInitialDownload);
}
void CDSNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload)
{
2017-08-11 20:51:24 +02:00
if (fInitialDownload || pindexNew == pindexFork) // In IBD or blocks were disconnected without any new ones
return;
2017-08-11 20:51:24 +02:00
mnodeman.UpdatedBlockTip(pindexNew);
privateSendClient.UpdatedBlockTip(pindexNew);
instantsend.UpdatedBlockTip(pindexNew);
mnpayments.UpdatedBlockTip(pindexNew);
governance.UpdatedBlockTip(pindexNew);
}
void CDSNotificationInterface::SyncTransaction(const CTransaction &tx, const CBlock *pblock)
{
instantsend.SyncTransaction(tx, pblock);
CPrivateSend::SyncTransaction(tx, pblock);
}