diff options
author | /dev/fd0 <alicexbt@protonmail.com> | 2022-03-22 03:49:01 +0530 |
---|---|---|
committer | /dev/fd0 <alicexbt@protonmail.com> | 2022-04-08 20:33:07 +0530 |
commit | 0cea7b10f1180e9993c14473e1a3b6525ef6ba01 (patch) | |
tree | 955e26937aaa652922c5e4d45b9932519a0be86e /src/bitcoin-cli.cpp | |
parent | e66630cc87c017f40ec29f6c1edf2ed5a286e49d (diff) |
print `(none)` if no warnings in -getinfo
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r-- | src/bitcoin-cli.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 5523fff3b2..5af9563450 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -1059,7 +1059,9 @@ static void ParseGetInfoResult(UniValue& result) result_string += "\n"; } - result_string += strprintf("%sWarnings:%s %s", YELLOW, RESET, result["warnings"].getValStr()); + const std::string warnings{result["warnings"].getValStr()}; + result_string += strprintf("%sWarnings:%s %s", YELLOW, RESET, warnings.empty() ? "(none)" : warnings); + result.setStr(result_string); } |