|
9 | 9 | #include <script/signingprovider.h> |
10 | 10 | #include <script/standard.h> |
11 | 11 | #include <util/error.h> |
| 12 | +#include <util/message.h> |
12 | 13 | #include <wallet/crypter.h> |
13 | 14 | #include <wallet/ismine.h> |
14 | 15 | #include <wallet/walletdb.h> |
@@ -214,6 +215,8 @@ class ScriptPubKeyMan |
214 | 215 |
|
215 | 216 | /** Creates new signatures and adds them to the transaction. Returns whether all inputs were signed */ |
216 | 217 | virtual bool SignTransaction(CMutableTransaction& tx, const std::map<COutPoint, Coin>& coins, int sighash, std::map<int, std::string>& input_errors) const { return false; } |
| 218 | + /** Sign a message with the given script */ |
| 219 | + virtual SigningResult SignMessage(const std::string& message, const PKHash& pkhash, std::string& str_sig) const { return SigningResult::SIGNING_FAILED; }; |
217 | 220 | /** Adds script and derivation path information to a PSBT, and optionally signs it. */ |
218 | 221 | virtual TransactionError FillPSBT(PartiallySignedTransaction& psbt, int sighash_type = 1 /* SIGHASH_ALL */, bool sign = true, bool bip32derivs = false) const { return TransactionError::INVALID_PSBT; } |
219 | 222 |
|
@@ -358,6 +361,7 @@ class LegacyScriptPubKeyMan : public ScriptPubKeyMan, public FillableSigningProv |
358 | 361 | bool CanProvide(const CScript& script, SignatureData& sigdata) override; |
359 | 362 |
|
360 | 363 | bool SignTransaction(CMutableTransaction& tx, const std::map<COutPoint, Coin>& coins, int sighash, std::map<int, std::string>& input_errors) const override; |
| 364 | + SigningResult SignMessage(const std::string& message, const PKHash& pkhash, std::string& str_sig) const override; |
361 | 365 | TransactionError FillPSBT(PartiallySignedTransaction& psbt, int sighash_type = 1 /* SIGHASH_ALL */, bool sign = true, bool bip32derivs = false) const override; |
362 | 366 |
|
363 | 367 | uint256 GetID() const override; |
|
0 commit comments