Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1// Copyright (c) 2026-present The Bitcoin Core developers2// Distributed under the MIT software license, see the accompanying3// file COPYING or https://www.opensource.org/licenses/mit-license.php.5#ifndef BITCOIN_WALLET_EXPORT_H6#define BITCOIN_WALLET_EXPORT_H8#include <threadsafety.h>9#include <util/expected.h>10#include <wallet/wallet.h>12#include <optional>13#include <vector>15namespace wallet {16// Struct containing all of the info from WalletDescriptor, except with the descriptor as a string,17// and without its ID.18// Used when exporting descriptors from the wallet.19struct WalletDescInfo {20std::string descriptor;21uint64_t creation_time;22bool active;23std::optional<bool> internal;24std::optional<std::pair<int64_t,int64_t>> range;25int64_t next_index;26DescriptorCache cache;27};29//! Export the descriptors from a wallet so that they can be imported elsewhere30util::Expected<std::vector<WalletDescInfo>, std::string> ExportDescriptors(const CWallet& wallet, bool export_private) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);32//! Make a new watchonly wallet file containing the public descriptors from this wallet33//! The exported watchonly wallet file will be named and placed at the path specified in 'destination'34util::Result<std::string> ExportWatchOnlyWallet(const CWallet& wallet, const fs::path& destination, WalletContext& context) EXCLUSIVE_LOCKS_REQUIRED(wallet.cs_wallet);35} // namespace wallet37#endif // BITCOIN_WALLET_EXPORT_H