Skip to content

Commit 71e57a2

Browse files
committed
Add masternode flag to result of getpeerinfo
1 parent 3182514 commit 71e57a2

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/net.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,7 @@ void CNode::copyStats(CNodeStats &stats)
760760
LOCK(cs_mnauth);
761761
X(verifiedProRegTxHash);
762762
}
763+
X(fMasternode);
763764
}
764765
#undef X
765766

src/net.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ class CNodeStats
707707
CAddress addrBind;
708708
// In case this is a verified MN, this value is the proTx of the MN
709709
uint256 verifiedProRegTxHash;
710+
bool fMasternode;
710711
};
711712

712713

src/rpc/net.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ UniValue getpeerinfo(const JSONRPCRequest& request)
9797
" \"subver\": \"/Dash Core:x.x.x/\", (string) The string version\n"
9898
" \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n"
9999
" \"addnode\": true|false, (boolean) Whether connection was due to addnode/-connect or if it was an automatic/inbound connection\n"
100+
" \"masternode\": true|false, (boolean) Whether connection was due to masternode connection attempt\n"
100101
" \"startingheight\": n, (numeric) The starting height (block) of the peer\n"
101102
" \"banscore\": n, (numeric) The ban score\n"
102103
" \"synced_headers\": n, (numeric) The last header we have in common with this peer\n"
@@ -164,6 +165,7 @@ UniValue getpeerinfo(const JSONRPCRequest& request)
164165
obj.push_back(Pair("subver", stats.cleanSubVer));
165166
obj.push_back(Pair("inbound", stats.fInbound));
166167
obj.push_back(Pair("addnode", stats.m_manual_connection));
168+
obj.push_back(Pair("masternode", stats.fMasternode));
167169
obj.push_back(Pair("startingheight", stats.nStartingHeight));
168170
if (fStateStats) {
169171
obj.push_back(Pair("banscore", statestats.nMisbehavior));

0 commit comments

Comments
 (0)