Add masternode flag to result of getpeerinfo

This commit is contained in:
Alexander Block 2020-03-20 12:22:05 +01:00
parent 31825146a3
commit 71e57a25fa
3 changed files with 4 additions and 0 deletions

View File

@ -760,6 +760,7 @@ void CNode::copyStats(CNodeStats &stats)
LOCK(cs_mnauth);
X(verifiedProRegTxHash);
}
X(fMasternode);
}
#undef X

View File

@ -707,6 +707,7 @@ public:
CAddress addrBind;
// In case this is a verified MN, this value is the proTx of the MN
uint256 verifiedProRegTxHash;
bool fMasternode;
};

View File

@ -97,6 +97,7 @@ UniValue getpeerinfo(const JSONRPCRequest& request)
" \"subver\": \"/Dash Core:x.x.x/\", (string) The string version\n"
" \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n"
" \"addnode\": true|false, (boolean) Whether connection was due to addnode/-connect or if it was an automatic/inbound connection\n"
" \"masternode\": true|false, (boolean) Whether connection was due to masternode connection attempt\n"
" \"startingheight\": n, (numeric) The starting height (block) of the peer\n"
" \"banscore\": n, (numeric) The ban score\n"
" \"synced_headers\": n, (numeric) The last header we have in common with this peer\n"
@ -164,6 +165,7 @@ UniValue getpeerinfo(const JSONRPCRequest& request)
obj.push_back(Pair("subver", stats.cleanSubVer));
obj.push_back(Pair("inbound", stats.fInbound));
obj.push_back(Pair("addnode", stats.m_manual_connection));
obj.push_back(Pair("masternode", stats.fMasternode));
obj.push_back(Pair("startingheight", stats.nStartingHeight));
if (fStateStats) {
obj.push_back(Pair("banscore", statestats.nMisbehavior));