|
27 | 27 | #include <util/hasher.h> |
28 | 28 | #include <util/result.h> |
29 | 29 | #include <util/string.h> |
| 30 | +#include <util/threadpool.h> |
30 | 31 | #include <util/time.h> |
31 | 32 | #include <util/ui_change_type.h> |
32 | 33 | #include <wallet/crypter.h> |
@@ -135,6 +136,9 @@ static const bool DEFAULT_WALLET_RBF = true; |
135 | 136 | static const bool DEFAULT_WALLETBROADCAST = true; |
136 | 137 | static const bool DEFAULT_DISABLE_WALLET = false; |
137 | 138 | static const bool DEFAULT_WALLETCROSSCHAIN = false; |
| 139 | +//! Default for -walletpar |
| 140 | +static const int DEFAULT_WALLETPAR = 0; |
| 141 | +static const int MAX_WALLETPAR = 16; |
138 | 142 | //! -maxtxfee default |
139 | 143 | constexpr CAmount DEFAULT_TRANSACTION_MAXFEE{COIN / 10}; |
140 | 144 | //! Discourage users to set fees higher than this amount (in satoshis) per kB |
@@ -403,6 +407,9 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati |
403 | 407 | /** Internal database handle. */ |
404 | 408 | std::unique_ptr<WalletDatabase> m_database; |
405 | 409 |
|
| 410 | + /** Thread pool for wallet operations. */ |
| 411 | + [[maybe_unused]] ThreadPool* m_thread_pool; |
| 412 | + |
406 | 413 | /** |
407 | 414 | * The following is used to keep track of how far behind the wallet is |
408 | 415 | * from the chain sync, and to allow clients to block on us being caught up. |
@@ -479,10 +486,11 @@ class CWallet final : public WalletStorage, public interfaces::Chain::Notificati |
479 | 486 | unsigned int nMasterKeyMaxID = 0; |
480 | 487 |
|
481 | 488 | /** Construct wallet with specified name and database implementation. */ |
482 | | - CWallet(interfaces::Chain* chain, const std::string& name, std::unique_ptr<WalletDatabase> database) |
| 489 | + CWallet(interfaces::Chain* chain, const std::string& name, std::unique_ptr<WalletDatabase> database, ThreadPool* thread_pool = nullptr) |
483 | 490 | : m_chain(chain), |
484 | 491 | m_name(name), |
485 | | - m_database(std::move(database)) |
| 492 | + m_database(std::move(database)), |
| 493 | + m_thread_pool(thread_pool) |
486 | 494 | { |
487 | 495 | } |
488 | 496 |
|
|
0 commit comments