Merge 006740b6f6 into merged_master (Bitcoin PR bitcoin/bitcoin#25721)

This commit is contained in:
Byron Hambly 2024-10-25 12:52:06 +02:00
commit 49d368ea6b
25 changed files with 282 additions and 160 deletions

View file

@ -160,7 +160,7 @@ public:
void abortRescan() override { m_wallet->AbortRescan(); }
bool backupWallet(const std::string& filename) override { return m_wallet->BackupWallet(filename); }
std::string getWalletName() override { return m_wallet->GetName(); }
BResult<CTxDestination> getNewDestination(const OutputType type, const std::string label, bool add_blinding_key = false) override
util::Result<CTxDestination> getNewDestination(const OutputType type, const std::string label, bool add_blinding_key = false) override
{
LOCK(m_wallet->cs_wallet);
return m_wallet->GetNewDestination(type, label, add_blinding_key);
@ -263,7 +263,7 @@ public:
LOCK(m_wallet->cs_wallet);
return m_wallet->ListLockedCoins(outputs);
}
BResult<CTransactionRef> createTransaction(const std::vector<CRecipient>& recipients,
util::Result<CTransactionRef> createTransaction(const std::vector<CRecipient>& recipients,
const CCoinControl& coin_control,
bool sign,
int& change_pos,
@ -271,10 +271,10 @@ public:
BlindDetails* blind_details) override
{
LOCK(m_wallet->cs_wallet);
const auto& res = CreateTransaction(*m_wallet, recipients, change_pos,
auto res = CreateTransaction(*m_wallet, recipients, change_pos,
coin_control, sign, blind_details);
if (!res) return res.GetError();
const auto& txr = res.GetObj();
if (!res) return util::Error{util::ErrorString(res)};
const auto& txr = *res;
fee = txr.fee;
change_pos = txr.change_pos;
@ -585,12 +585,12 @@ public:
options.require_existing = true;
return MakeWallet(m_context, LoadWallet(m_context, name, true /* load_on_start */, options, status, error, warnings));
}
BResult<std::unique_ptr<Wallet>> restoreWallet(const fs::path& backup_file, const std::string& wallet_name, std::vector<bilingual_str>& warnings) override
util::Result<std::unique_ptr<Wallet>> restoreWallet(const fs::path& backup_file, const std::string& wallet_name, std::vector<bilingual_str>& warnings) override
{
DatabaseStatus status;
bilingual_str error;
BResult<std::unique_ptr<Wallet>> wallet{MakeWallet(m_context, RestoreWallet(m_context, backup_file, wallet_name, /*load_on_start=*/true, status, error, warnings))};
if (!wallet) return error;
util::Result<std::unique_ptr<Wallet>> wallet{MakeWallet(m_context, RestoreWallet(m_context, backup_file, wallet_name, /*load_on_start=*/true, status, error, warnings))};
if (!wallet) return util::Error{error};
return wallet;
}
std::string getWalletDir() override