diff --git a/src/net.cpp b/src/net.cpp index 4088fb5a8d..0d0ae670b1 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -820,6 +820,7 @@ void CNode::copyStats(CNodeStats &stats) { LOCK(cs_mnauth); X(verifiedProRegTxHash); + X(verifiedPubKeyHash); } X(m_masternode_connection); } diff --git a/src/net.h b/src/net.h index 2ff2f55d7c..758d144227 100644 --- a/src/net.h +++ b/src/net.h @@ -773,6 +773,8 @@ public: CAddress addrBind; // In case this is a verified MN, this value is the proTx of the MN uint256 verifiedProRegTxHash; + // In case this is a verified MN, this value is the hashed operator pubkey of the MN + uint256 verifiedPubKeyHash; bool m_masternode_connection; }; diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp index 15c9c6010e..2f6d8d53bc 100644 --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -81,8 +81,11 @@ UniValue getpeerinfo(const JSONRPCRequest& request) " \"addrlocal\":\"ip:port\", (string) Local address as reported by the peer\n" " \"services\":\"xxxxxxxxxxxxxxxx\", (string) The services offered\n" " \"verified_proregtx_hash\": h, (hex) Only present when the peer is a masternode and succesfully\n" - " autheticated via MNAUTH. In this case, this field contains the\n" + " authenticated via MNAUTH. In this case, this field contains the\n" " protx hash of the masternode\n" + " \"verified_pubkey_hash\": h, (hex) Only present when the peer is a masternode and succesfully\n" + " authenticated via MNAUTH. In this case, this field contains the\n" + " hash of the masternode's operator public key\n" " \"relaytxes\":true|false, (boolean) Whether peer has asked us to relay transactions to it\n" " \"lastsend\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last send\n" " \"lastrecv\": ttt, (numeric) The time in seconds since epoch (Jan 1 1970 GMT) of the last receive\n" @@ -145,6 +148,9 @@ UniValue getpeerinfo(const JSONRPCRequest& request) if (!stats.verifiedProRegTxHash.IsNull()) { obj.pushKV("verified_proregtx_hash", stats.verifiedProRegTxHash.ToString()); } + if (!stats.verifiedPubKeyHash.IsNull()) { + obj.pushKV("verified_pubkey_hash", stats.verifiedPubKeyHash.ToString()); + } obj.pushKV("relaytxes", stats.fRelayTxes); obj.pushKV("lastsend", stats.nLastSend); obj.pushKV("lastrecv", stats.nLastRecv);