* Allow compilation with `--disable-wallet`
* fix remaining references
* Drop wallet references/include in CActiveMasternode and fix other files affected by this change
* Wrap privatesend-client.h include with ifdef/endif and fix other files affected by this change
* Re-enable Travis build with no wallet
reverts 267e57877b
This monstrous change eliminates all remaining uses of
g_connman global variable in Dash-specific code.
Unlike previous changes eliminating g_connman use
that were isolated to particular modules, this one covers
multiple modules simultaneously because they are so interdependent
that change in one module was quickly spreading to others.
This is mostly invariant change that was done by
* changing all functions using g_connman to use connman argument,
* changing all functions calling these functions to use connman argument,
* repeating previous step until there's nothing to change.
After multiple iterations, this process converged to final result,
producing code that is mostly equivalent to original one, but passing
CConnman instance through arguments instead of global variable.
The only exception to equivalence of resulting code is that I had to
create overload of CMasternodeMan::CheckAndRemove() method without arguments
that does nothing just for use in CFlatDB<CMasternodeMan>::Dump() and
CFlatDB<CMasternodeMan>::Load() methods.
Normal CMasternodeMan::CheckAndRemove() overload now has argument of
CConnman& type and is used everywhere else.
The normal overload has this code in the beginning:
if(!masternodeSync.IsMasternodeListSynced()) return;
Masternode list is not synced yet when we load "mncache.dat" file,
and we save "mncache.dat" file on shutdown, so I presume that it's OK
to use overload that does nothing in both cases.
Signed-off-by: Oleg Girko <ol@infoserver.lv>
- add `MASTERNODE_SYNC_WAITING` sync state/asset and initial timeout
- wait for block headers to be downloaded (new signal `AcceptedBlockHeader`)
- wait for blocks to reach best headers tip before switching to masternode list sync (new signal `NotifyHeaderTip`)
- switched sync from `UpdatedBlockTip` to a combination of `AcceptedBlockHeader` and `NotifyHeaderTip`
- all blockchain-related bumps should take place only while we are still syncing blockchain, should be no such bumps after that
* Change sync process:
- IsBlockchainSynced(): drop CheckNodeHeight() and all complicated code, use fInitialDownload in UpdatedBlockTip() to switch initial states
- ProcessTick(): detect sleep mode like it was in IsBlockchainSynced(), not by number of masternodes
* Changes for sync in governance:
- do not keep sync alive on ConfirmInventoryRequest()
- skip some governance actions until we are synced to some level
* do not run CMasternodeMan::UpdateLastPaid() until winners list is synced
* start syncing mn list on the same node right after requesting sporks
* replace nTimeLast<Asset> with the unified nTimeLastBumped, bump on UpdatedBlockTip
* fix comments and LogPrintf-s
* remove excessive MASTERNODE_SYNC_IBD
* a bit more descriptive BumpAssetLastTime in few cases
* Multi-quorum InstantSend, complete refactoring
+ cleanup for IS and partial protobump
* more changes:
- allow InstantSend tx to have 10 inputs max
- store many unique tx hashes in mapVotedOutpoints
- more checks in AcceptToMemoryPoolWorker (moved from ProcessMessage + CTxLockRequest(tx).IsValid() )
* More changes:
- let multiple lock candidates compete for votes
- fail to vote on the same outpoint twice early
* More changes:
- notify CInstantSend on UpdatedBlockTip -> remove cs_main from CheckAndRemove()
- notify CInstantSend on SyncTransaction -> count expiration block starting from the block corresponding tx was confirmed instead of the block lock candidate/vote was created
- fixed few locks
* add comments about nConfirmedHeight
* Fix "Block vs Lock" edge case
* Fix "Block vs Lock" edge case, p2
* Fix issues:
- fix logic for locking inputs and notifying - see UpdateLockedTransaction, TryToFinalizeLockCandidate
- add missing hash inserting in ProcessTxLockVote
- add nMaxBlocks param to ResolveConflicts to limit max depth allowed to disconnect blocks recursively
- fix false positive mempool conflict
- add missing mutex locks
- fix fRequireUnspent logic in CTxLockRequest::IsValid