From 6a9c429084b40356aa36aa67992da35f61c2f6a2 Mon Sep 17 00:00:00 2001 From: Andrew Chow Date: Thu, 13 Feb 2020 17:09:12 -0500 Subject: [PATCH] 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. --- src/interfaces/wallet.cpp | 4 ++++ src/interfaces/wallet.h | 4 ++++ src/qt/signverifymessagedialog.cpp | 27 +++++++++++++++++---------- src/util/message.cpp | 14 ++++++++++++++ src/util/message.h | 8 ++++++++ src/wallet/rpcwallet.cpp | 20 +++++--------------- src/wallet/scriptpubkeyman.cpp | 14 ++++++++++++++ src/wallet/scriptpubkeyman.h | 4 ++++ src/wallet/wallet.cpp | 12 ++++++++++++ src/wallet/wallet.h | 2 ++ 10 files changed, 84 insertions(+), 25 deletions(-) diff --git a/src/interfaces/wallet.cpp b/src/interfaces/wallet.cpp index 83ce9aba740..7b3ab27b503 100644 --- a/src/interfaces/wallet.cpp +++ b/src/interfaces/wallet.cpp @@ -132,6 +132,10 @@ public: } return false; } + SigningResult signMessage(const std::string& message, const PKHash& pkhash, std::string& str_sig) override + { + return m_wallet->SignMessage(message, pkhash, str_sig); + } bool isSpendable(const CTxDestination& dest) override { return m_wallet->IsMine(dest) & ISMINE_SPENDABLE; } bool haveWatchOnly() override { diff --git a/src/interfaces/wallet.h b/src/interfaces/wallet.h index 964608ff827..6f27ee126d8 100644 --- a/src/interfaces/wallet.h +++ b/src/interfaces/wallet.h @@ -10,6 +10,7 @@ #include