[dashpay/dash] Masternode related refactorings in preparation of DIP3 (#2212)

UdjinM6 requested changes on this pull request.

757b6e5 doesn’t fit `refactoring` title, should be removed from this PR imo (and I don’t quite understand the need for it tbh). See other comments below.

> @@ -10,27 +10,27 @@
#include «protocol.h»

// Keep track of the active Masternode
-CActiveMasternode activeMasternode;
+CActiveMasternodeInfo activeMasternode;

Should probably change the name to `activeMasternodeInfo` for it to be a bit more descriptive.

>
static const int ACTIVE_MASTERNODE_INITIAL = 0; // initial state
static const int ACTIVE_MASTERNODE_SYNC_IN_PROCESS = 1;
static const int ACTIVE_MASTERNODE_INPUT_TOO_NEW = 2;
static const int ACTIVE_MASTERNODE_NOT_CAPABLE = 3;
static const int ACTIVE_MASTERNODE_STARTED = 4;

-extern CActiveMasternode activeMasternode;
+extern CActiveMasternodeInfo activeMasternode;
+extern CActiveLegacyMasternodeManager legacyActiveMasternodeManager;
+
+class CActiveMasternodeInfo {

s/`class`/`struct`/

> @@ -25,7 +25,7 @@ extern CActiveLegacyMasternodeManager legacyActiveMasternodeManager;
class CActiveMasternodeInfo {
public:
// Keys for the active Masternode
— CPubKey pubKeyMasternode;
+ CKeyID pubKeyIDMasternode;

Should drop `pub` prefix i.e. s/`pubKeyIDMasternode`/`keyIDMasternode`/. Same for all other new `CKeyID`s.

Добавить комментарий