neobytes/src/masternode-sync.h
Evan Duffield 8187228be1 Fixed budget syncing issues / forking issues / syncing issues
- Budgets now store the seen objects locally so they're not overwritten when saving/loading to check validity of budget.dat
- Added safer sync "failure" mode, that will retry an hour later if the sync fails for some reason. This will stop the client from thinking it has budget data and rejecting blocks when they're valid.
- protocol bump
- version bump
2015-07-25 09:29:29 -07:00

50 lines
1.2 KiB
C++

// Copyright (c) 2014-2015 The Dash developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef MASTERNODE_SYNC_H
#define MASTERNODE_SYNC_H
#define MASTERNODE_SYNC_INITIAL 0
#define MASTERNODE_SYNC_SPORKS 1
#define MASTERNODE_SYNC_LIST 2
#define MASTERNODE_SYNC_MNW 3
#define MASTERNODE_SYNC_BUDGET 4
#define MASTERNODE_SYNC_FAILED 998
#define MASTERNODE_SYNC_FINISHED 999
#define MASTERNODE_SYNC_TIMEOUT 15
class CMasternodeSync;
extern CMasternodeSync masternodeSync;
//
// CMasternodeSync : Sync masternode assets in stages
//
class CMasternodeSync
{
public:
int64_t lastMasternodeList;
int64_t lastMasternodeWinner;
int64_t lastBudgetItem;
int64_t lastFailure;
// Count peers we've requested the list from
int RequestedMasternodeAssets;
int RequestedMasternodeAttempt;
CMasternodeSync();
void AddedMasternodeList();
void AddedMasternodeWinner();
void AddedBudgetItem();
void GetNextAsset();
void Process();
bool IsSynced();
};
#endif