mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 05:32:22 +02:00
Instead of creating a DescriptorSPKM that doesn't have a descriptor, only to then generate the descriptor, combine SetupDescriptorGeneration into the GenerateNewSingleSig factory function, and within that function, generate the descriptor first before constructing the new DescriptorSPKM.
37 lines
1.5 KiB
C++
37 lines
1.5 KiB
C++
// Copyright (c) 2019-present The Bitcoin Core developers
|
|
// Distributed under the MIT software license, see the accompanying
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
#ifndef BITCOIN_WALLET_EXTERNAL_SIGNER_SCRIPTPUBKEYMAN_H
|
|
#define BITCOIN_WALLET_EXTERNAL_SIGNER_SCRIPTPUBKEYMAN_H
|
|
|
|
#include <wallet/scriptpubkeyman.h>
|
|
|
|
#include <memory>
|
|
#include <util/result.h>
|
|
|
|
struct bilingual_str;
|
|
|
|
namespace wallet {
|
|
class ExternalSignerScriptPubKeyMan : public DescriptorScriptPubKeyMan
|
|
{
|
|
private:
|
|
using DescriptorScriptPubKeyMan::DescriptorScriptPubKeyMan;
|
|
|
|
public:
|
|
static std::unique_ptr<ExternalSignerScriptPubKeyMan> LoadFromStorage(WalletStorage& storage, WalletDescriptor& descriptor, int64_t keypool_size, const KeyMap& keys, const CryptedKeyMap& ckeys);
|
|
static std::unique_ptr<ExternalSignerScriptPubKeyMan> CreateNew(WalletStorage& storage, WalletBatch& batch, int64_t keypool_size, std::unique_ptr<Descriptor> desc);
|
|
|
|
static util::Result<ExternalSigner> GetExternalSigner();
|
|
|
|
/**
|
|
* Display address on the device and verify that the returned value matches.
|
|
* @returns nothing or an error message
|
|
*/
|
|
util::Result<void> DisplayAddress(const CTxDestination& dest, const ExternalSigner& signer) const;
|
|
|
|
std::optional<common::PSBTError> FillPSBT(PartiallySignedTransaction& psbt, const PrecomputedTransactionData& txdata, const common::PSBTFillOptions& options, int* n_signed = nullptr) const override;
|
|
};
|
|
} // namespace wallet
|
|
#endif // BITCOIN_WALLET_EXTERNAL_SIGNER_SCRIPTPUBKEYMAN_H
|