mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
Create wallet RPCs for PSBT
walletprocesspsbt takes a PSBT format transaction, updates the PSBT with any inputs related to this wallet, signs, and finalizes the transaction. There is also an option to not sign and just update. walletcreatefundedpsbt creates a PSBT from user provided data in the same form as createrawtransaction. It also funds the transaction and takes an options argument in the same form as fundrawtransaction. The resulting PSBT is blank with no input or output data filled in.
This commit is contained in:
@@ -614,3 +614,13 @@ void PSBTOutput::Merge(const PSBTOutput& output)
|
||||
if (redeem_script.empty() && !output.redeem_script.empty()) redeem_script = output.redeem_script;
|
||||
if (witness_script.empty() && !output.witness_script.empty()) witness_script = output.witness_script;
|
||||
}
|
||||
|
||||
bool PublicOnlySigningProvider::GetCScript(const CScriptID &scriptid, CScript& script) const
|
||||
{
|
||||
return m_provider->GetCScript(scriptid, script);
|
||||
}
|
||||
|
||||
bool PublicOnlySigningProvider::GetPubKey(const CKeyID &address, CPubKey& pubkey) const
|
||||
{
|
||||
return m_provider->GetPubKey(address, pubkey);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,17 @@ public:
|
||||
|
||||
extern const SigningProvider& DUMMY_SIGNING_PROVIDER;
|
||||
|
||||
class PublicOnlySigningProvider : public SigningProvider
|
||||
{
|
||||
private:
|
||||
const SigningProvider* m_provider;
|
||||
|
||||
public:
|
||||
PublicOnlySigningProvider(const SigningProvider* provider) : m_provider(provider) {}
|
||||
bool GetCScript(const CScriptID &scriptid, CScript& script) const;
|
||||
bool GetPubKey(const CKeyID &address, CPubKey& pubkey) const;
|
||||
};
|
||||
|
||||
/** Interface for signature creators. */
|
||||
class BaseSignatureCreator {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user