@@ -520,10 +520,18 @@ UniValue masternodelist(const JSONRPCRequest& request)
520
520
521
521
mnList.ForEachMN (false , [&](const CDeterministicMNCPtr& dmn) {
522
522
std::string strOutpoint = dmn->collateralOutpoint .ToStringShort ();
523
+ Coin coin;
524
+ std::string collateralAddressStr = " UNKNOWN" ;
525
+ if (GetUTXOCoin (dmn->collateralOutpoint , coin)) {
526
+ CTxDestination collateralDest;
527
+ if (ExtractDestination (coin.out .scriptPubKey , collateralDest)) {
528
+ collateralAddressStr = CBitcoinAddress (collateralDest).ToString ();
529
+ }
530
+ }
523
531
524
532
CScript payeeScript = dmn->pdmnState ->scriptPayout ;
525
533
CTxDestination payeeDest;
526
- std::string payeeStr = " UNKOWN " ;
534
+ std::string payeeStr = " UNKNOWN " ;
527
535
if (ExtractDestination (payeeScript, payeeDest)) {
528
536
payeeStr = CBitcoinAddress (payeeDest).ToString ();
529
537
}
@@ -564,6 +572,7 @@ UniValue masternodelist(const JSONRPCRequest& request)
564
572
dmn->pdmnState ->nLastPaidHeight << " " <<
565
573
CBitcoinAddress (dmn->pdmnState ->keyIDOwner ).ToString () << " " <<
566
574
CBitcoinAddress (dmn->pdmnState ->keyIDVoting ).ToString () << " " <<
575
+ collateralAddressStr << " " <<
567
576
dmn->pdmnState ->pubKeyOperator .ToString ();
568
577
std::string strInfo = streamInfo.str ();
569
578
if (strFilter !=" " && strInfo.find (strFilter) == std::string::npos &&
@@ -576,6 +585,7 @@ UniValue masternodelist(const JSONRPCRequest& request)
576
585
objMN.push_back (Pair (" lastpaidblock" , dmn->pdmnState ->nLastPaidHeight ));
577
586
objMN.push_back (Pair (" owneraddress" , CBitcoinAddress (dmn->pdmnState ->keyIDOwner ).ToString ()));
578
587
objMN.push_back (Pair (" votingaddress" , CBitcoinAddress (dmn->pdmnState ->keyIDVoting ).ToString ()));
588
+ objMN.push_back (Pair (" collateraladdress" , collateralAddressStr));
579
589
objMN.push_back (Pair (" pubkeyoperator" , dmn->pdmnState ->pubKeyOperator .ToString ()));
580
590
obj.push_back (Pair (strOutpoint, objMN));
581
591
} else if (strMode == " lastpaidblock" ) {
0 commit comments