node::GetWarningsForRpc

RPC helper function that wraps warnings.GetMessages().

Synopsis

Declared in <node/warnings.h>

UniValue
GetWarningsForRpc(
    Warnings const& warnings,
    bool use_deprecated);

Description

Returns a UniValue::VSTR with the latest warning if use_deprecated is set to true, or a UniValue::VARR with all warnings otherwise.

Return Value

A UniValue string or array holding the active warnings.

Parameters

NameDescription
warningsThe warnings manager to read messages from.
use_deprecatedIf true, return only the latest warning as a string; otherwise return all warnings as an array.