23
23
#include < utility>
24
24
#include < vector>
25
25
26
- class CCoinControl ;
27
26
class CFeeRate ;
28
27
class CKey ;
29
- class CWallet ;
30
28
enum class FeeReason ;
31
29
enum class OutputType ;
32
30
enum class TransactionError ;
31
+ struct PartiallySignedTransaction ;
32
+ struct bilingual_str ;
33
+ namespace wallet {
34
+ class CCoinControl ;
35
+ class CWallet ;
33
36
enum isminetype : unsigned int ;
34
37
struct CRecipient ;
35
- struct PartiallySignedTransaction ;
36
38
struct WalletContext ;
37
- struct bilingual_str ;
38
39
using isminefilter = std::underlying_type<isminetype>::type;
40
+ } // namespace wallet
39
41
40
42
namespace interfaces {
41
43
@@ -107,7 +109,7 @@ class Wallet
107
109
// ! Look up address in wallet, return whether exists.
108
110
virtual bool getAddress (const CTxDestination& dest,
109
111
std::string* name,
110
- isminetype* is_mine,
112
+ wallet:: isminetype* is_mine,
111
113
std::string* purpose) = 0;
112
114
113
115
// ! Get wallet address list.
@@ -135,8 +137,8 @@ class Wallet
135
137
virtual void listLockedCoins (std::vector<COutPoint>& outputs) = 0;
136
138
137
139
// ! Create transaction.
138
- virtual CTransactionRef createTransaction (const std::vector<CRecipient>& recipients,
139
- const CCoinControl& coin_control,
140
+ virtual CTransactionRef createTransaction (const std::vector<wallet:: CRecipient>& recipients,
141
+ const wallet:: CCoinControl& coin_control,
140
142
bool sign,
141
143
int & change_pos,
142
144
CAmount& fee,
@@ -158,7 +160,7 @@ class Wallet
158
160
159
161
// ! Create bump transaction.
160
162
virtual bool createBumpTransaction (const uint256& txid,
161
- const CCoinControl& coin_control,
163
+ const wallet:: CCoinControl& coin_control,
162
164
std::vector<bilingual_str>& errors,
163
165
CAmount& old_fee,
164
166
CAmount& new_fee,
@@ -213,19 +215,19 @@ class Wallet
213
215
virtual CAmount getBalance () = 0;
214
216
215
217
// ! Get available balance.
216
- virtual CAmount getAvailableBalance (const CCoinControl& coin_control) = 0;
218
+ virtual CAmount getAvailableBalance (const wallet:: CCoinControl& coin_control) = 0;
217
219
218
220
// ! Return whether transaction input belongs to wallet.
219
- virtual isminetype txinIsMine (const CTxIn& txin) = 0;
221
+ virtual wallet:: isminetype txinIsMine (const CTxIn& txin) = 0;
220
222
221
223
// ! Return whether transaction output belongs to wallet.
222
- virtual isminetype txoutIsMine (const CTxOut& txout) = 0;
224
+ virtual wallet:: isminetype txoutIsMine (const CTxOut& txout) = 0;
223
225
224
226
// ! Return debit amount if transaction input belongs to wallet.
225
- virtual CAmount getDebit (const CTxIn& txin, isminefilter filter) = 0;
227
+ virtual CAmount getDebit (const CTxIn& txin, wallet:: isminefilter filter) = 0;
226
228
227
229
// ! Return credit amount if transaction input belongs to wallet.
228
- virtual CAmount getCredit (const CTxOut& txout, isminefilter filter) = 0;
230
+ virtual CAmount getCredit (const CTxOut& txout, wallet:: isminefilter filter) = 0;
229
231
230
232
// ! Return AvailableCoins + LockedCoins grouped by wallet address.
231
233
// ! (put change in one group with wallet address)
@@ -240,7 +242,7 @@ class Wallet
240
242
241
243
// ! Get minimum fee.
242
244
virtual CAmount getMinimumFee (unsigned int tx_bytes,
243
- const CCoinControl& coin_control,
245
+ const wallet:: CCoinControl& coin_control,
244
246
int * returned_target,
245
247
FeeReason* reason) = 0;
246
248
@@ -307,7 +309,7 @@ class Wallet
307
309
virtual std::unique_ptr<Handler> handleCanGetAddressesChanged (CanGetAddressesChangedFn fn) = 0;
308
310
309
311
// ! Return pointer to internal wallet class, useful for testing.
310
- virtual CWallet* wallet () { return nullptr ; }
312
+ virtual wallet:: CWallet* wallet () { return nullptr ; }
311
313
};
312
314
313
315
// ! Wallet chain client that in addition to having chain client methods for
@@ -341,18 +343,18 @@ class WalletLoader : public ChainClient
341
343
virtual std::unique_ptr<Handler> handleLoadWallet (LoadWalletFn fn) = 0;
342
344
343
345
// ! Return pointer to internal context, useful for testing.
344
- virtual WalletContext* context () { return nullptr ; }
346
+ virtual wallet:: WalletContext* context () { return nullptr ; }
345
347
};
346
348
347
349
// ! Information about one wallet address.
348
350
struct WalletAddress
349
351
{
350
352
CTxDestination dest;
351
- isminetype is_mine;
353
+ wallet:: isminetype is_mine;
352
354
std::string name;
353
355
std::string purpose;
354
356
355
- WalletAddress (CTxDestination dest, isminetype is_mine, std::string name, std::string purpose)
357
+ WalletAddress (CTxDestination dest, wallet:: isminetype is_mine, std::string name, std::string purpose)
356
358
: dest(std::move(dest)), is_mine(is_mine), name(std::move(name)), purpose(std::move(purpose))
357
359
{
358
360
}
@@ -382,10 +384,10 @@ struct WalletBalances
382
384
struct WalletTx
383
385
{
384
386
CTransactionRef tx;
385
- std::vector<isminetype> txin_is_mine;
386
- std::vector<isminetype> txout_is_mine;
387
+ std::vector<wallet:: isminetype> txin_is_mine;
388
+ std::vector<wallet:: isminetype> txout_is_mine;
387
389
std::vector<CTxDestination> txout_address;
388
- std::vector<isminetype> txout_address_is_mine;
390
+ std::vector<wallet:: isminetype> txout_address_is_mine;
389
391
CAmount credit;
390
392
CAmount debit;
391
393
CAmount change;
@@ -420,7 +422,7 @@ struct WalletTxOut
420
422
421
423
// ! Return implementation of Wallet interface. This function is defined in
422
424
// ! dummywallet.cpp and throws if the wallet component is not compiled.
423
- std::unique_ptr<Wallet> MakeWallet (WalletContext& context, const std::shared_ptr<CWallet>& wallet);
425
+ std::unique_ptr<Wallet> MakeWallet (wallet:: WalletContext& context, const std::shared_ptr<wallet:: CWallet>& wallet);
424
426
425
427
// ! Return implementation of ChainClient interface for a wallet loader. This
426
428
// ! function will be undefined in builds where ENABLE_WALLET is false.
0 commit comments