diff options
author | Andrew Chow <achow101-github@achow101.com> | 2020-02-13 17:09:12 -0500 |
---|---|---|
committer | Andrew Chow <achow101-github@achow101.com> | 2020-03-09 11:16:20 -0400 |
commit | 6a9c429084b40356aa36aa67992da35f61c2f6a2 (patch) | |
tree | e2590bf410fd5c78b4e6edd5805ba99802130de6 /src/wallet/scriptpubkeyman.h | |
parent | 82a30fade70a2a95c2bbeac4aa06dafda600479d (diff) |
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/wallet/scriptpubkeyman.h')
-rw-r--r-- | src/wallet/scriptpubkeyman.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/scriptpubkeyman.h b/src/wallet/scriptpubkeyman.h index 1628001a74..ab0d1c37bd 100644 --- a/src/wallet/scriptpubkeyman.h +++ b/src/wallet/scriptpubkeyman.h @@ -9,6 +9,7 @@ #include <script/signingprovider.h> #include <script/standard.h> #include <util/error.h> +#include <util/message.h> #include <wallet/crypter.h> #include <wallet/ismine.h> #include <wallet/walletdb.h> @@ -214,6 +215,8 @@ public: /** Creates new signatures and adds them to the transaction. Returns whether all inputs were signed */ virtual bool SignTransaction(CMutableTransaction& tx, const std::map<COutPoint, Coin>& coins, int sighash, std::map<int, std::string>& input_errors) const { return false; } + /** Sign a message with the given script */ + virtual SigningResult SignMessage(const std::string& message, const PKHash& pkhash, std::string& str_sig) const { return SigningResult::SIGNING_FAILED; }; /** Adds script and derivation path information to a PSBT, and optionally signs it. */ virtual TransactionError FillPSBT(PartiallySignedTransaction& psbt, int sighash_type = 1 /* SIGHASH_ALL */, bool sign = true, bool bip32derivs = false) const { return TransactionError::INVALID_PSBT; } @@ -358,6 +361,7 @@ public: bool CanProvide(const CScript& script, SignatureData& sigdata) override; bool SignTransaction(CMutableTransaction& tx, const std::map<COutPoint, Coin>& coins, int sighash, std::map<int, std::string>& input_errors) const override; + SigningResult SignMessage(const std::string& message, const PKHash& pkhash, std::string& str_sig) const override; TransactionError FillPSBT(PartiallySignedTransaction& psbt, int sighash_type = 1 /* SIGHASH_ALL */, bool sign = true, bool bip32derivs = false) const override; uint256 GetID() const override; |