rpc: extract wallet "warnings" fields to a util helper

This commit is contained in:
Jon Atack
2023-03-19 10:16:09 -07:00
parent f73782a903
commit 079d8cdda8
5 changed files with 18 additions and 4 deletions

View File

@@ -1225,7 +1225,7 @@ static UniValue ProcessImport(CWallet& wallet, const UniValue& data, const int64
result.pushKV("error", JSONRPCError(RPC_MISC_ERROR, "Missing required fields"));
}
if (warnings.size()) result.pushKV("warnings", warnings);
PushWarnings(warnings, result);
return result;
}
@@ -1579,7 +1579,7 @@ static UniValue ProcessDescriptorImport(CWallet& wallet, const UniValue& data, c
result.pushKV("success", UniValue(false));
result.pushKV("error", e);
}
if (warnings.size()) result.pushKV("warnings", warnings);
PushWarnings(warnings, result);
return result;
}