比特币源码学习笔记

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

2018-08-03  本文已影响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;
}
上一篇下一篇

猜你喜欢

热点阅读