fix supports and fix printing of claimid and value for updates
This commit is contained in:
parent
31008a84b2
commit
0551e881f5
2 changed files with 18 additions and 3 deletions
|
@ -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));
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue