From 0551e881f507f328939e356ad0f5e065aa926417 Mon Sep 17 00:00:00 2001 From: Jimmy Kiselak Date: Mon, 11 Jul 2016 23:37:17 -0400 Subject: [PATCH] fix supports and fix printing of claimid and value for updates --- src/rpc/claimtrie.cpp | 10 +++++++++- src/wallet/rpcwallet.cpp | 11 +++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/rpc/claimtrie.cpp b/src/rpc/claimtrie.cpp index 1307a1c6f..38c178127 100644 --- a/src/rpc/claimtrie.cpp +++ b/src/rpc/claimtrie.cpp @@ -164,7 +164,15 @@ UniValue getvalueforname(const UniValue& params, bool fHelp) { LogPrintf("%s: the specified txout of %s does not have a name claim command\n", __func__, claim.outPoint.hash.GetHex()); } - std::string sValue(vvchParams[1].begin(), vvchParams[1].end()); + std::string sValue; + if (op == OP_CLAIM_NAME) + { + sValue = std::string(vvchParams[1].begin(), vvchParams[1].end()); + } + else if (op == OP_UPDATE_CLAIM) + { + sValue = std::string(vvchParams[2].begin(), vvchParams[2].end()); + } ret.push_back(Pair("value", sValue)); ret.push_back(Pair("txid", claim.outPoint.hash.GetHex())); ret.push_back(Pair("n", (int)claim.outPoint.n)); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 6e23e42ff..5b9d2b51e 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -692,9 +692,16 @@ void ListNameClaims(const CWalletTx& wtx, const string& strAccount, int nMinDept string sValue (vvchParams[1].begin(), vvchParams[1].end()); entry.push_back(Pair("value", sValue)); } + else if (op == OP_UPDATE_CLAIM) + { + uint160 claimId(vvchParams[1]); + entry.push_back(Pair("claimId", claimId.GetHex())); + string sValue(vvchParams[2].begin(), vvchParams[2].end()); + entry.push_back(Pair("value", sValue)); + } else if (op == OP_SUPPORT_CLAIM) { - uint256 claimId(vvchParams[1]); + uint160 claimId(vvchParams[1]); entry.push_back(Pair("supported_claimid", claimId.GetHex())); } entry.push_back(Pair("txid", wtx.GetHash().ToString())); @@ -849,7 +856,7 @@ UniValue supportclaim(const UniValue& params, bool fHelp) EnsureWalletIsUnlocked(); - CScript supportScript = CScript() << OP_SUPPORT_CLAIM << vchName << vchClaimId << OP_2DROP << OP_2DROP; + CScript supportScript = CScript() << OP_SUPPORT_CLAIM << vchName << vchClaimId << OP_2DROP << OP_DROP; CreateClaim(supportScript, nAmount, wtx);