diff options
Diffstat (limited to 'src/external_signer.cpp')
-rw-r--r-- | src/external_signer.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/external_signer.cpp b/src/external_signer.cpp index 5524b943f4..6b1e1f0241 100644 --- a/src/external_signer.cpp +++ b/src/external_signer.cpp @@ -30,7 +30,7 @@ bool ExternalSigner::Enumerate(const std::string& command, std::vector<ExternalS } for (const UniValue& signer : result.getValues()) { // Check for error - const UniValue& error = find_value(signer, "error"); + const UniValue& error = signer.find_value("error"); if (!error.isNull()) { if (!error.isStr()) { throw std::runtime_error(strprintf("'%s' error", command)); @@ -38,11 +38,11 @@ bool ExternalSigner::Enumerate(const std::string& command, std::vector<ExternalS throw std::runtime_error(strprintf("'%s' error: %s", command, error.getValStr())); } // Check if fingerprint is present - const UniValue& fingerprint = find_value(signer, "fingerprint"); + const UniValue& fingerprint = signer.find_value("fingerprint"); if (fingerprint.isNull()) { throw std::runtime_error(strprintf("'%s' received invalid response, missing signer fingerprint", command)); } - const std::string fingerprintStr = fingerprint.get_str(); + const std::string& fingerprintStr{fingerprint.get_str()}; // Skip duplicate signer bool duplicate = false; for (const ExternalSigner& signer : signers) { @@ -50,7 +50,7 @@ bool ExternalSigner::Enumerate(const std::string& command, std::vector<ExternalS } if (duplicate) break; std::string name; - const UniValue& model_field = find_value(signer, "model"); + const UniValue& model_field = signer.find_value("model"); if (model_field.isStr() && model_field.getValStr() != "") { name += model_field.getValStr(); } @@ -97,19 +97,19 @@ bool ExternalSigner::SignTransaction(PartiallySignedTransaction& psbtx, std::str const UniValue signer_result = RunCommandParseJSON(command, stdinStr); - if (find_value(signer_result, "error").isStr()) { - error = find_value(signer_result, "error").get_str(); + if (signer_result.find_value("error").isStr()) { + error = signer_result.find_value("error").get_str(); return false; } - if (!find_value(signer_result, "psbt").isStr()) { + if (!signer_result.find_value("psbt").isStr()) { error = "Unexpected result from signer"; return false; } PartiallySignedTransaction signer_psbtx; std::string signer_psbt_error; - if (!DecodeBase64PSBT(signer_psbtx, find_value(signer_result, "psbt").get_str(), signer_psbt_error)) { + if (!DecodeBase64PSBT(signer_psbtx, signer_result.find_value("psbt").get_str(), signer_psbt_error)) { error = strprintf("TX decode failed %s", signer_psbt_error); return false; } |