Skip to content

Commit

Permalink
Merge branch 'KYAN-develop' of https://github.com/decenomy/DSW
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro-at-decenomy committed Jan 10, 2023
2 parents 4e69cbb + 4595ba8 commit 345b008
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 39 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2021)
Expand Down
5 changes: 3 additions & 2 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,13 @@ static Checkpoints::MapCheckpoints mapCheckpoints =
(612695, uint256S("ce050536a70e48d2705217c94dffb88df5c056bda2f7a2e43f5ce61455e9e1ab"))
(618947, uint256S("d1688bf2e27b25dc84a9e588182c15bd564a38685fe6ed90460be17d044f9615"))
(625199, uint256S("17e062cb0ff30a233a2b539a04ff57e1fc75ab1a4b5ddd4f4d8766276e9fa915"))
(738170, uint256S("fc4e5b120f2fa141cb16eb90571793bd95961af0613315ca7e36bd8171590b3d"))
;

static const Checkpoints::CCheckpointData data = {
&mapCheckpoints,
1666169445, // * UNIX timestamp of last checkpoint block
1361307, // * total number of transactions between genesis and last checkpoint
1673112480, // * UNIX timestamp of last checkpoint block
1600255, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the UpdateTip debug.log lines)
2840 // * estimated number of transactions per day after checkpoint. 2000 for 10 minutes of bitcoin blockchain (1M block size). With 2M of block size and 1 minute of block time, this field should be around 4000 * 10 * 6 * 24 = 5760000
};
Expand Down
67 changes: 31 additions & 36 deletions src/rpc/masternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,25 +297,9 @@ UniValue startmasternode (const JSONRPCRequest& request)

if (amn.GetStatus() != ACTIVE_MASTERNODE_STARTED) {
amn.ResetStatus();
if (fLock)
pwalletMain->Lock();
}

CMasternode* pmn = mnodeman.Find(*(amn.vin));

if (pmn) {
UniValue mnObj(UniValue::VOBJ);
mnObj.push_back(Pair("alias", amn.strAlias));
mnObj.push_back(Pair("txhash", amn.vin->prevout.hash.ToString()));
mnObj.push_back(Pair("outputidx", (uint64_t)amn.vin->prevout.n));
mnObj.push_back(Pair("netaddr", amn.service.ToString()));
mnObj.push_back(Pair("addr", EncodeDestination(pmn->pubKeyCollateralAddress.GetID())));
mnObj.push_back(Pair("status", amn.GetStatus()));
mnObj.push_back(Pair("message", amn.GetStatusMessage()));
if (legacy && amn.strAlias == "legacy") return amn.GetStatusMessage();
resultsObj.push_back(mnObj);
} else {
UniValue mnObj(UniValue::VOBJ);
if (amn.vin == nullopt) {
mnObj.push_back(Pair("alias", amn.strAlias));
mnObj.push_back(Pair("txhash", "N/A"));
mnObj.push_back(Pair("outputidx", -1));
Expand All @@ -324,11 +308,26 @@ UniValue startmasternode (const JSONRPCRequest& request)
mnObj.push_back(Pair("status", amn.GetStatus()));
mnObj.push_back(Pair("message", amn.GetStatusMessage()));
resultsObj.push_back(mnObj);
if (legacy && amn.strAlias == "legacy") return amn.GetStatusMessage();
if(legacy) break;
continue;
}

CMasternode* pmn = mnodeman.Find(*(amn.vin));

mnObj.push_back(Pair("alias", amn.strAlias));
mnObj.push_back(Pair("txhash", amn.vin->prevout.hash.ToString()));
mnObj.push_back(Pair("outputidx", (uint64_t)amn.vin->prevout.n));
mnObj.push_back(Pair("netaddr", amn.service.ToString()));
mnObj.push_back(Pair("addr", pmn ? EncodeDestination(pmn->pubKeyCollateralAddress.GetID()) : "N/A"));
mnObj.push_back(Pair("status", amn.GetStatus()));
mnObj.push_back(Pair("message", amn.GetStatusMessage()));
resultsObj.push_back(mnObj);
if (legacy) break;
}

if (fLock) pwalletMain->Lock();
if(legacy) amns[0].GetStatusMessage();

return resultsObj;
}

Expand All @@ -352,10 +351,9 @@ UniValue startmasternode (const JSONRPCRequest& request)
CMasternodeBroadcast mnb;
std::string errorMessage;
bool fSuccess = false;
if (!StartMasternodeEntry(statusObj, mnb, fSuccess, mne, errorMessage, strCommand))
continue;
if (StartMasternodeEntry(statusObj, mnb, fSuccess, mne, errorMessage, strCommand))
RelayMNB(mnb, fSuccess, successful, failed);
resultsObj.push_back(statusObj);
RelayMNB(mnb, fSuccess, successful, failed);
}
if (fLock)
pwalletMain->Lock();
Expand Down Expand Up @@ -545,6 +543,7 @@ UniValue getmasternodestatus(const JSONRPCRequest& request)
auto legacy = amns.size() == 1 && amns[0].strAlias == "legacy";

for (auto& amn : amns) {

if (amn.vin == nullopt) {
UniValue mnObj(UniValue::VOBJ);
mnObj.push_back(Pair("alias", amn.strAlias));
Expand All @@ -555,26 +554,22 @@ UniValue getmasternodestatus(const JSONRPCRequest& request)
mnObj.push_back(Pair("status", amn.GetStatus()));
mnObj.push_back(Pair("message", amn.GetStatusMessage()));
resultsObj.push_back(mnObj);
if(legacy && amn.strAlias == "legacy") return mnObj;
if(legacy) return mnObj;
continue;
}

CMasternode* pmn = mnodeman.Find(*(amn.vin));

if (pmn) {
UniValue mnObj(UniValue::VOBJ);
mnObj.push_back(Pair("alias", amn.strAlias));
mnObj.push_back(Pair("txhash", amn.vin->prevout.hash.ToString()));
mnObj.push_back(Pair("outputidx", (uint64_t)amn.vin->prevout.n));
mnObj.push_back(Pair("netaddr", amn.service.ToString()));
mnObj.push_back(Pair("addr", EncodeDestination(pmn->pubKeyCollateralAddress.GetID())));
mnObj.push_back(Pair("status", amn.GetStatus()));
mnObj.push_back(Pair("message", amn.GetStatusMessage()));
if(legacy && amn.strAlias == "legacy") return mnObj;
resultsObj.push_back(mnObj);
} else {
throw std::runtime_error("Masternode not found in the list of available masternodes. Current status: " + amn.GetStatusMessage());
}
UniValue mnObj(UniValue::VOBJ);
mnObj.push_back(Pair("alias", amn.strAlias));
mnObj.push_back(Pair("txhash", amn.vin->prevout.hash.ToString()));
mnObj.push_back(Pair("outputidx", (uint64_t)amn.vin->prevout.n));
mnObj.push_back(Pair("netaddr", amn.service.ToString()));
mnObj.push_back(Pair("addr", pmn ? EncodeDestination(pmn->pubKeyCollateralAddress.GetID()) : "N/A"));
mnObj.push_back(Pair("status", amn.GetStatus()));
mnObj.push_back(Pair("message", amn.GetStatusMessage()));
if(legacy) return mnObj;
resultsObj.push_back(mnObj);
}

return resultsObj;
Expand Down

0 comments on commit 345b008

Please sign in to comment.