diff options
| author | j-berman <justinberman@protonmail.com> | 2022-10-13 18:33:33 -0700 |
|---|---|---|
| committer | j-berman <justinberman@protonmail.com> | 2024-05-24 20:42:59 -0700 |
| commit | e44e8b164030cfbddb9ae8b39251c1ccf396e2b6 (patch) | |
| tree | 987d979f7d89e1515c57453b5b666a82b795f12e /src/wallet/api/wallet.h | |
| parent | 24ccaba6ef429fdd37a3281c586e655987201a5c (diff) | |
| download | monzero-core-e44e8b164030cfbddb9ae8b39251c1ccf396e2b6.tar.gz monzero-core-e44e8b164030cfbddb9ae8b39251c1ccf396e2b6.tar.xz monzero-core-e44e8b164030cfbddb9ae8b39251c1ccf396e2b6.zip | |
wallet: background sync with just the view key
- When background syncing, the wallet wipes the spend key
from memory and processes all new transactions. The wallet saves
all receives, spends, and "plausible" spends of receives the
wallet does not know key images for.
- When background sync disabled, the wallet processes all
background synced txs and then clears the background sync cache.
- Adding "plausible" spends to the background sync cache ensures
that the wallet does not need to query the daemon to see if any
received outputs were spent while background sync was enabled.
This would harm privacy especially for users of 3rd party daemons.
- To enable the feature in the CLI wallet, the user can set
background-sync to reuse-wallet-password or
custom-background-password and the wallet automatically syncs in
the background when the wallet locks, then processes all
background synced txs when the wallet is unlocked.
- The custom-background-password option enables the user to
open a distinct background wallet that only has a view key saved
and can be opened/closed/synced separately from the main wallet.
When the main wallet opens, it processes the background wallet's
cache.
- To enable the feature in the RPC wallet, there is a new
`/setup_background_sync` endpoint.
- HW, multsig and view-only wallets cannot background sync.
Diffstat (limited to 'src/wallet/api/wallet.h')
| -rw-r--r-- | src/wallet/api/wallet.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h index ec2d7e9b3..1f199a72c 100644 --- a/src/wallet/api/wallet.h +++ b/src/wallet/api/wallet.h @@ -171,6 +171,13 @@ public: bool importOutputs(const std::string &filename) override; bool scanTransactions(const std::vector<std::string> &txids) override; + bool setupBackgroundSync(const BackgroundSyncType background_sync_type, const std::string &wallet_password, const optional<std::string> &background_cache_password = optional<std::string>()) override; + BackgroundSyncType getBackgroundSyncType() const override; + bool startBackgroundSync() override; + bool stopBackgroundSync(const std::string &wallet_password) override; + bool isBackgroundSyncing() const override; + bool isBackgroundWallet() const override; + virtual void disposeTransaction(PendingTransaction * t) override; virtual uint64_t estimateTransactionFee(const std::vector<std::pair<std::string, uint64_t>> &destinations, PendingTransaction::Priority priority) const override; @@ -239,6 +246,7 @@ private: bool isNewWallet() const; void pendingTxPostProcess(PendingTransactionImpl * pending); bool doInit(const std::string &daemon_address, const std::string &proxy_address, uint64_t upper_transaction_size_limit = 0, bool ssl = false); + bool checkBackgroundSync(const std::string &message) const; private: friend class PendingTransactionImpl; @@ -253,6 +261,10 @@ private: mutable boost::mutex m_statusMutex; mutable int m_status; mutable std::string m_errorString; + // TODO: harden password handling in the wallet API, see relevant discussion + // https://github.com/monero-project/monero-gui/issues/1537 + // https://github.com/feather-wallet/feather/issues/72#issuecomment-1405602142 + // https://github.com/monero-project/monero/pull/8619#issuecomment-1632951461 std::string m_password; std::unique_ptr<TransactionHistoryImpl> m_history; std::unique_ptr<Wallet2CallbackImpl> m_wallet2Callback; |
