Skip to content

Commit

Permalink
Add missing ownerAddress to getcustomtx (#1584)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bushstar authored Nov 18, 2022
1 parent fff6b77 commit 1d169a7
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/masternodes/rpc_customtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,21 @@ class CCustomTxRpcVisitor

void operator()(const CUpdateMasterNodeMessage& obj) const {
rpcInfo.pushKV("id", obj.mnId.GetHex());
for (const auto& item : obj.updates) {
if (item.first == static_cast<uint8_t>(UpdateMasternodeType::OperatorAddress)) {
rpcInfo.pushKV("operatorAddress", EncodeDestination(item.second.first == PKHashType ?
CTxDestination(PKHash(item.second.second)) :
CTxDestination(WitnessV0KeyHash(item.second.second))));
} else if (item.first == static_cast<uint8_t>(UpdateMasternodeType::SetRewardAddress)) {
rpcInfo.pushKV("rewardAddress", EncodeDestination(item.second.first == PKHashType ?
CTxDestination(PKHash(item.second.second)) :
CTxDestination(WitnessV0KeyHash(item.second.second))));
} else if (item.first == static_cast<uint8_t>(UpdateMasternodeType::RemRewardAddress)) {
for (const auto& [updateType, addressPair] : obj.updates) {
const auto& [addressType, rawAddress] = addressPair;
if (updateType == static_cast<uint8_t>(UpdateMasternodeType::OperatorAddress)) {
rpcInfo.pushKV("operatorAddress", EncodeDestination(addressType == PKHashType ?
CTxDestination(PKHash(rawAddress)) :
CTxDestination(WitnessV0KeyHash(rawAddress))));
} else if (updateType == static_cast<uint8_t>(UpdateMasternodeType::OwnerAddress)) {
rpcInfo.pushKV("ownerAddress", EncodeDestination(addressType == PKHashType ?
CTxDestination(PKHash(rawAddress)) :
CTxDestination(WitnessV0KeyHash(rawAddress))));
} if (updateType == static_cast<uint8_t>(UpdateMasternodeType::SetRewardAddress)) {
rpcInfo.pushKV("rewardAddress", EncodeDestination(addressType == PKHashType ?
CTxDestination(PKHash(rawAddress)) :
CTxDestination(WitnessV0KeyHash(rawAddress))));
} else if (updateType == static_cast<uint8_t>(UpdateMasternodeType::RemRewardAddress)) {
rpcInfo.pushKV("rewardAddress", "");
}
}
Expand Down

0 comments on commit 1d169a7

Please sign in to comment.