diff --git a/src/script/keva.cpp b/src/script/keva.cpp index c3fd3cb4c..7a3f82ac3 100644 --- a/src/script/keva.cpp +++ b/src/script/keva.cpp @@ -8,7 +8,7 @@ const std::string CKevaScript::KEVA_DISPLAY_NAME_KEY = "_KEVA_NS_"; -const unsigned char CKevaScript::NAMESPACE_PREFIX = 21; // 2 in base58 +const unsigned char CKevaScript::NAMESPACE_PREFIX = 52; // M in Base58Check CKevaScript::CKevaScript (const CScript& script) : op(OP_NOP), address(script) diff --git a/src/wallet/rpckeva.cpp b/src/wallet/rpckeva.cpp index 9581d0a15..c24902af5 100644 --- a/src/wallet/rpckeva.cpp +++ b/src/wallet/rpckeva.cpp @@ -90,7 +90,7 @@ UniValue keva_namespace(const JSONRPCRequest& request) KEVA_LOCKED_AMOUNT, false, wtx, coinControl); keyName.KeepKey(); - std::string kevaNamespaceBase58 = EncodeBase58(kevaNamespace); + std::string kevaNamespaceBase58 = EncodeBase58Check(kevaNamespace); const std::string txid = wtx.GetHash().GetHex(); LogPrintf("keva_namespace: namespace=%s, displayName=%s, tx=%s\n", kevaNamespaceBase58.c_str(), displayNameStr.c_str(), txid.c_str()); @@ -98,7 +98,6 @@ UniValue keva_namespace(const JSONRPCRequest& request) UniValue res(UniValue::VARR); res.push_back(txid); res.push_back(kevaNamespaceBase58); - return res; } @@ -161,7 +160,7 @@ UniValue keva_list_namespaces(const JSONRPCRequest& request) } const valtype nameSpace = kevaOp.getOpNamespace(); - const std::string nameSpaceStr = EncodeBase58(nameSpace); + const std::string nameSpaceStr = EncodeBase58Check(nameSpace); const CBlockIndex* pindex; const int depth = tx.GetDepthInMainChain(pindex); if (depth <= 0) { @@ -188,7 +187,7 @@ UniValue keva_list_namespaces(const JSONRPCRequest& request) std::vector> unconfirmedNamespaces; mempool.getUnconfirmedNamespaceList(unconfirmedNamespaces); for (auto entry : unconfirmedNamespaces) { - res.push_back(EncodeBase58(std::get<0>(entry)) + " : " + ValtypeToString(std::get<1>(entry))); + res.push_back(EncodeBase58Check(std::get<0>(entry)) + " : " + ValtypeToString(std::get<1>(entry))); } } @@ -393,7 +392,7 @@ UniValue keva_pending(const JSONRPCRequest& request) for (auto entry: unconfirmedNamespaces) { UniValue obj(UniValue::VOBJ); obj.pushKV("op", opKevaNamepsace); - obj.pushKV("namespace", EncodeBase58(std::get<0>(entry))); + obj.pushKV("namespace", EncodeBase58Check(std::get<0>(entry))); obj.pushKV("display name", ValtypeToString(std::get<1>(entry))); obj.pushKV("txid", std::get<2>(entry).ToString()); arr.push_back(obj); @@ -402,7 +401,7 @@ UniValue keva_pending(const JSONRPCRequest& request) for (auto entry: unconfirmedKeyValueList) { UniValue obj(UniValue::VOBJ); obj.pushKV("op", opKevaPut); - obj.pushKV("namespace", EncodeBase58(std::get<0>(entry))); + obj.pushKV("namespace", EncodeBase58Check(std::get<0>(entry))); obj.pushKV("key", ValtypeToString(std::get<1>(entry))); obj.pushKV("value", ValtypeToString(std::get<2>(entry))); obj.pushKV("txid", std::get<3>(entry).ToString()); diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 986d8366c..16f38f9fb 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -2277,7 +2277,7 @@ void CWallet::AvailableCoins(std::vector &vCoins, bool fOnlySafe, const CKevaScript kevaOp(pcoin->tx->vout[i].scriptPubKey); if (kevaOp.isKevaOp()) { if (kevaNamespace) { - if (*kevaNamespace == EncodeBase58(kevaOp.getOpNamespace())) { + if (*kevaNamespace == EncodeBase58Check(kevaOp.getOpNamespace())) { vCoins.push_back(COutput(pcoin, i, nDepth, fSpendableIn, fSolvableIn, safeTx)); return; }