Commit Graph

4 Commits

Author SHA1 Message Date
UdjinM6
7e96af4e65
Refactor PrivateSend (#1735)
* make infoMixingMasternode private

* move PS queue entries expiration checks (and cs_darksend) to CPrivateSendBase

* drop CTxDSOut

* move prevPubKey out of CTxIn into CTxDSIn and use CTxDSIn explicitly

* drop CPrivateSendClient::NewBlock

* move IsDenominatedAmount to CPrivateSend

* move IsCollateralAmount to CPrivateSend

* drop darksend-relay.cpp/h

* drop GetMasternodeByRank
2017-12-04 09:06:07 +03:00
Oleg Girko
753b1e486b Eliminate remaining uses of g_connman in Dash-specific code. (#1635)
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>
2017-09-19 17:51:38 +03:00
UdjinM6
029ee64948 split CPrivateSend (#1492)
* split CPrivateSend:
- common client/server base data structures/functions: CPrivateSendBase
- singleton-like helper: CPrivateSend

* GetCollateralAmount(), more of GetSmallestDenomination()

* refactor GetDSTX

* remove excessive static_cast<bool>

* bring back LOCK(cs_mapdstx) :)

* address review comments

* fix bool operator
2017-06-30 21:30:16 +03:00
UdjinM6
7242e29228 Refactor PS (#1437)
* split CDarksendPool

* split DoAutomaticDenominating

* CMasternode* -> masternode_info_t

* move some globals into CPrivateSendClient

* addressed PR comments
2017-05-05 14:26:27 +03:00