Post
Topic
Board Development & Technical Discussion
Re: New RPC- Paramaters are not parsed correctly
by
liorko87
on 31/05/2021, 10:14:39 UTC
This is the updated code:

Code:
for (int i = 0; i < request.params.size(); i++) {
        std::cout << "param value: " << request.params[i].get_str() << " param type: " <<
            request.params[i].getType() << std::endl;
    }
    std::cout << "inside function" << std:: endl;
    const int64_t num_blocks{request.params[0].get_int64()};
    const uint64_t max_tries{request.params[3].isNull() ? DEFAULT_MAX_TRIES : request.params[3].get_int64()};

For me the getType() function redirects to UniValue class at:
https://github.com/bitcoin/bitcoin/blob/master/src/univalue/include/univalue.h#L64
Type 3 is VSTR according to the VType enum