aboutsummaryrefslogtreecommitdiff
path: root/src/util/message.cpp
diff options
context:
space:
mode:
authorAndrew Chow <achow101-github@achow101.com>2020-02-13 17:09:12 -0500
committerAndrew Chow <achow101-github@achow101.com>2020-03-09 11:16:20 -0400
commit6a9c429084b40356aa36aa67992da35f61c2f6a2 (patch)
treee2590bf410fd5c78b4e6edd5805ba99802130de6 /src/util/message.cpp
parent82a30fade70a2a95c2bbeac4aa06dafda600479d (diff)
downloadbitcoin-6a9c429084b40356aa36aa67992da35f61c2f6a2.tar.xz
Move direct calls to MessageSign into new SignMessage functions in CWallet and ScriptPubKeyMan
Instead of getting a SigningProvider and then going to MessageSign, have ScriptPubKeyMan handle the message signing internally.
Diffstat (limited to 'src/util/message.cpp')
-rw-r--r--src/util/message.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/util/message.cpp b/src/util/message.cpp
index 17603a43d2..1e7128d225 100644
--- a/src/util/message.cpp
+++ b/src/util/message.cpp
@@ -76,3 +76,17 @@ uint256 MessageHash(const std::string& message)
return hasher.GetHash();
}
+
+std::string SigningResultString(const SigningResult res)
+{
+ switch (res) {
+ case SigningResult::OK:
+ return "No error";
+ case SigningResult::PRIVATE_KEY_NOT_AVAILABLE:
+ return "Private key not available";
+ case SigningResult::SIGNING_FAILED:
+ return "Sign failed";
+ // no default case, so the compiler can warn about missing cases
+ }
+ assert(false);
+}