美文网首页比特币源码学习笔记
比特币源码阅读(获得余额-解析参数"钱包名称")

比特币源码阅读(获得余额-解析参数"钱包名称")

作者: 坠叶飘香 | 来源:发表于2018-08-03 17:37 被阅读0次

src/wallet/rpcwallet.cpp

从JSONRPCRequest当前URI(字符串)里面获得携带的wallet_name参数,赋值到wallet_name

static const std::string WALLET_ENDPOINT_BASE = "/wallet/";
bool GetWalletNameFromJSONRPCRequest(const JSONRPCRequest& request, std::string& wallet_name)
{
    if (request.URI.substr(0, WALLET_ENDPOINT_BASE.size()) == WALLET_ENDPOINT_BASE) {
        // wallet endpoint was used
        wallet_name = urlDecode(request.URI.substr(WALLET_ENDPOINT_BASE.size()));
        return true;
    }
    return false;
}

相关文章

网友评论

    本文标题:比特币源码阅读(获得余额-解析参数"钱包名称")

    本文链接:https://www.haomeiwen.com/subject/cmduvftx.html