mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
Add SignTransaction function to ScriptPubKeyMan and LegacyScriptPubKeyMan
This commit is contained in:
parent
2c52b59d0a
commit
d999dd588c
@ -5,6 +5,7 @@
|
||||
#include <key_io.h>
|
||||
#include <outputtype.h>
|
||||
#include <script/descriptor.h>
|
||||
#include <script/sign.h>
|
||||
#include <util/bip32.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/translation.h>
|
||||
@ -505,6 +506,11 @@ bool LegacyScriptPubKeyMan::CanProvide(const CScript& script, SignatureData& sig
|
||||
}
|
||||
}
|
||||
|
||||
bool LegacyScriptPubKeyMan::SignTransaction(CMutableTransaction& tx, const std::map<COutPoint, Coin>& coins, int sighash, std::map<int, std::string>& input_errors) const
|
||||
{
|
||||
return ::SignTransaction(tx, this, coins, sighash, input_errors);
|
||||
}
|
||||
|
||||
const CKeyMetadata* LegacyScriptPubKeyMan::GetMetadata(const CTxDestination& dest) const
|
||||
{
|
||||
LOCK(cs_KeyStore);
|
||||
|
@ -210,6 +210,9 @@ public:
|
||||
*/
|
||||
virtual bool CanProvide(const CScript& script, SignatureData& sigdata) { return false; }
|
||||
|
||||
/** 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; }
|
||||
|
||||
virtual uint256 GetID() const { return uint256(); }
|
||||
|
||||
/** Prepends the wallet name in logging output to ease debugging in multi-wallet use cases */
|
||||
@ -350,6 +353,8 @@ 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;
|
||||
|
||||
uint256 GetID() const override;
|
||||
|
||||
// Map from Key ID to key metadata.
|
||||
|
Loading…
Reference in New Issue
Block a user