Bitcoin Core
32.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
wallet
export.h
Go to the documentation of this file.
1
// Copyright (c) 2026-present The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or https://www.opensource.org/licenses/mit-license.php.
4
5
#ifndef BITCOIN_WALLET_EXPORT_H
6
#define BITCOIN_WALLET_EXPORT_H
7
8
#include <
threadsafety.h
>
9
#include <
util/expected.h
>
10
#include <
wallet/wallet.h
>
11
12
#include <optional>
13
#include <vector>
14
15
namespace
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.
19
struct
WalletDescInfo
{
20
std::string
descriptor
;
21
uint64_t
creation_time
;
22
bool
active
;
23
std::optional<bool>
internal
;
24
std::optional<std::pair<int64_t,int64_t>>
range
;
25
int64_t
next_index
;
26
DescriptorCache
cache
;
27
};
28
30
util::Expected<std::vector<WalletDescInfo>
, std::string>
ExportDescriptors
(
const
CWallet
&
wallet
,
bool
export_private)
EXCLUSIVE_LOCKS_REQUIRED
(
wallet
.cs_wallet);
31
34
util::Result<std::string>
ExportWatchOnlyWallet
(
const
CWallet
&
wallet
,
const
fs::path& destination,
WalletContext
& context)
EXCLUSIVE_LOCKS_REQUIRED
(
wallet
.cs_wallet);
35
}
// namespace wallet
36
37
#endif
// BITCOIN_WALLET_EXPORT_H
DescriptorCache
Cache for single descriptor's derived extended pubkeys.
Definition
descriptor.h:29
util::Expected
The util::Expected class provides a standard way for low-level functions to return either error value...
Definition
expected.h:44
util::Result
Definition
result.h:36
wallet::CWallet
A CWallet maintains a set of transactions and balances, and provides the ability to create new transa...
Definition
wallet.h:310
expected.h
wallet
Definition
coin_selection.cpp:31
wallet::ExportWatchOnlyWallet
util::Result< std::string > ExportWatchOnlyWallet(const CWallet &wallet, const fs::path &destination, WalletContext &context)
Definition
export.cpp:47
wallet::ExportDescriptors
util::Expected< std::vector< WalletDescInfo >, std::string > ExportDescriptors(const CWallet &wallet, bool export_private)
Export the descriptors from a wallet so that they can be imported elsewhere.
Definition
export.cpp:18
wallet::WalletContext
Definition
context.h:36
wallet::WalletDescInfo
Definition
export.h:19
wallet::WalletDescInfo::internal
std::optional< bool > internal
Definition
export.h:23
wallet::WalletDescInfo::range
std::optional< std::pair< int64_t, int64_t > > range
Definition
export.h:24
wallet::WalletDescInfo::next_index
int64_t next_index
Definition
export.h:25
wallet::WalletDescInfo::descriptor
std::string descriptor
Definition
export.h:20
wallet::WalletDescInfo::creation_time
uint64_t creation_time
Definition
export.h:21
wallet::WalletDescInfo::cache
DescriptorCache cache
Definition
export.h:26
wallet::WalletDescInfo::active
bool active
Definition
export.h:22
threadsafety.h
EXCLUSIVE_LOCKS_REQUIRED
#define EXCLUSIVE_LOCKS_REQUIRED(...)
Definition
threadsafety.h:49
wallet.h
Generated on
for Bitcoin Core by
1.18.0