1515 Commits

Author SHA1 Message Date
j-berman
ab9bc6499c wallet2: fix edge case where tx's ki's remain marked unspent
If a tx is marked as failed (because it never shows up in the
daemon's pool), its key images get reset back to unspent so they
can be used in future txs.

If the tx re-enters the daemon's pool (e.g. it's removed from the
pool and then relayed back), then the wallet incorrectly maintains
that the tx's key images are unspent.

This change ensures the wallet re-marks the tx's key images as
spent if the tx re-appears in the node's pool.
2025-12-12 09:15:48 -08:00
tobtoht
b4a168b5f8
Merge pull request #10083
daded36 wallet: identify spends in pool when scanning (j-berman)
2025-10-27 18:50:40 +00:00
tobtoht
0237f04617
Merge pull request #10172
5905b20 wallet: sanity check ring indices only against spendable (jeffro256)
2025-10-27 18:47:03 +00:00
jeffro256
5905b202f0
wallet: sanity check ring indices only against spendable 2025-10-15 17:00:21 -05:00
j-berman
1dbb4a7928 wallet2: warn instead of throw when RingDB doesn't include spend
A reorg can end up causing an output's position in the chain to
move. Since the wallet doesn't update the RingDB on reorg, it
may refer to the output's stale position in the chain.

This seems a reasonable solution rather than introducing complex
logic to update the stale ring member's value on rerog, since
RingDB can be deprecated with FCMP++.
2025-09-17 15:21:46 -07:00
j-berman
daded36823 wallet: identify spends in pool when scanning
- Make sure to mark identified spends in the pool as spends. The
wallet might not know these have been spent if it wasn't the wallet
that relayed the tx to the daemon, or the wallet was cleared via
rescan_bc.
- Make sure to add spends to m_unconfirmed_txs if not present.
- Make sure to process the entire pool again if refreshing for
the first time. The wallet fetches pool and blocks at the same
time. The wallet scans blocks first, then pool. If the wallet
identifies received outputs in the chain, then it may have spent
those received outputs in the pool. So we make sure to re-process
the entire pool again after scanning the chain for the first time.
- Multisig wallets that know about spent key images can now detect
spend txs in the pool. Update tests for that.
2025-09-15 14:14:50 -07:00
tobtoht
8259df0d1d
Merge pull request #9860
dbc8402 wallet: fix wallet_keys_unlocker (jeffro256)
2025-09-08 18:08:22 +00:00
jeffro256
dbc8402da6
wallet: fix wallet_keys_unlocker
Fix four issues with wallet_keys_unlocker:
1. It won't decrypt if there are unlockers open simulataneously on multiple `wallet2` instances
2. It won't decrypt if the first unlocker was disabled (i.e. `locked=false`), even with a second non-disabled unlocker
3. If a destructor of an earlier unlocker is triggered before the destructor of a later unlocker, it will re-encrypt too early, while the second unlocker is still in scope
4. Calling the 3-parameter constructor with `locked=true` after an unlocker already exists will "double-encrypt"  the spend key after its destructor since the local variable is `locked=false` and the field member is `locked=true`

Also, replace `wallet2::decrypt_account_for_multisig` with `wallet_keys_unlocker`.
2025-09-04 15:43:38 -05:00
jeffro256
dc350f35a5
wallet: deprecate wallet2::find_and_save_rings()
Rings for outgoing transactions are stored within the scanning code since the last hardfork,
so this code is largely unneccessary now.

Co-authored-by: j-berman <justinberman@protonmail.com>
2025-07-29 12:28:39 -05:00
tobtoht
08438b60c1
Merge pull request #9838
2f2a8c4 wallet: Improve Fee Priority Code for Clarity (tzadiko)
2025-07-10 12:45:39 +00:00
tobtoht
6f2efeca1e
Merge pull request #9940
e9c89dc wallet: kill support for deprecated ephemeral Boost messages (jeffro256)
2025-07-10 12:29:13 +00:00
tobtoht
8b95b38fa2
Merge pull request #9953
6d06de7 wallet: refactor subaddress expansion & add to transfer test (jeffro256)
6e26e44 wallet: improve lookahead logic & make rpc persistent (Justin Berman)
6f36037 wallet: create set_subaddress_lookahead wallet rpc endpoint (benevanoff)
b987676 wallet: ensure subaddress keys table is at least size of requested lookahead (benevanoff)
2025-07-10 12:20:49 +00:00
tzadiko
2f2a8c46bb wallet: Improve Fee Priority Code for Clarity 2025-07-09 20:08:42 -05:00
jeffro256
6d06de74b2 wallet: refactor subaddress expansion & add to transfer test 2025-07-07 22:16:11 +00:00
Justin Berman
6e26e4477e wallet: improve lookahead logic & make rpc persistent 2025-07-07 22:16:09 +00:00
benevanoff
b987676d63 wallet: ensure subaddress keys table is at least size of requested lookahead 2025-06-27 21:35:16 +00:00
Oscar Mira
19fab4d38e
wallet2: ignore checkpoints in fast_refresh when height < 1000 2025-06-27 00:35:56 +02:00
tobtoht
bc33cdfe29
Merge pull request #9935
69345db wallet2: use nearest checkpoint to allow fast_refresh on old accounts (Oscar Mira)
edc447e checkpoints: support nearest lower checkpoint lookup (Oscar Mira)
2025-06-14 18:58:52 +00:00
jeffro256
e9c89dc6ab
wallet: kill support for deprecated ephemeral Boost messages
The commit kills support for deprecated ephemeral Boost messages: signed/unsigned transaction sets, pending transactions, reserve proofs, MMS messages, etc.
It does NOT kill support for loading very old wallets in Boost format, that should be supported indefinitely. These messages were deprecated 5 years ago. Since
then, we have had a hard fork to enable a new non-compatible transaction type (w/ view tags), and disable the old transaction type. This renders basically all
of the aforementioned messages before that HF useless, with the possible exception of reserve proofs.

This commit also cleans up dead inclusions of boost serialization headers.

This commit is part of upstreaming Carrot/FCMP++. Killing support for Boost messages now means less boilerplate Boost serialization review for Carrot/FCMP++.
2025-05-30 14:24:56 -05:00
Oscar Mira
69345dbe29
wallet2: use nearest checkpoint to allow fast_refresh on old accounts 2025-05-23 19:27:19 +02:00
tobtoht
627bb04b98
Merge pull request #9851
70fe289d8 Improve move/copy/default constructor semantics for tx and block (Lee *!* Clagett)
2025-04-23 16:14:50 +00:00
tobtoht
28dd16181b
Merge pull request #9863
c848e21c4 fix: multisig stale data after failed refresh (SNeedlewoods)
2025-04-23 16:12:45 +00:00
SNeedlewoods
c848e21c43 fix: multisig stale data after failed refresh 2025-03-28 12:48:38 +01:00
tobtoht
4b127d9c6b
Merge pull request #9842
30ae2deed Correct Max / Min Block Waiting Periods (tzadiko)
2025-03-26 12:35:32 +00:00
tzadiko
30ae2deed5 Correct Max / Min Block Waiting Periods 2025-03-25 16:55:43 -05:00
Lee *!* Clagett
70fe289d82 Improve move/copy/default constructor semantics for tx and block 2025-03-21 14:02:12 -04:00
jeffro256
5393bef139
wallet: fix different-signedness int comparison warnings 2025-03-13 04:10:29 -05:00
j-berman
98decee8ac wallet2: remove refresh() from scan_tx
Fixes #9354
2025-01-14 13:37:46 -08:00
luigi1111
0d51fd9caa
Merge pull request #9601
c06ebec wallet: shortchain history should include base block (0xFFFC0000)
2025-01-06 12:23:05 -05:00
luigi1111
3a414c5132
Merge pull request #9565
7cd33d1 Fix typos. (Soren Stoutner)
2024-12-23 10:54:08 -05:00
luigi1111
f00cb9421a
Merge pull request #9490
31c6b2a wallet: can't decrypt payment id if tx key is missing (tobtoht)
2024-12-23 10:38:25 -05:00
0xFFFC0000
c06ebeceb7 wallet: shortchain history should include base block 2024-12-03 23:06:32 +00:00
Soren Stoutner
7cd33d1dbc Fix typos. 2024-11-11 17:01:52 -07:00
j-berman
e866a192dd wallet2: move wallet error on RPC resp handling to wallet_errors file
Co-authored-by: jeffro256 <jeffro256@tutanota.com>
2024-10-29 10:56:11 -07:00
tobtoht
31c6b2a901
wallet: can't decrypt payment id if tx key is missing 2024-09-26 14:29:12 +02:00
jeffro256
ed955bf751
build: fix build with Boost 1.85 and remove instances of viewkey logging
1. Use `std::is_standard_layout` and `std::is_trivially_copyable` instead of `std::is_pod` for KV byte-wise serialization, which fixes compile issue for Boost UUIDs
2. Use `std::has_unique_object_representations` instead of `alignof(T) == 1` for epee byte spans and epee hex functions
3. Removed reimplementation of `std::hash` for `boost::uuids::uuid
4. Removed `<<` operator overload for `crypto::secret_key`
5. Removed instances in code where private view key was dumped to the log in plaintext
2024-09-06 11:46:22 -05:00
luigi1111
28788bc031
Merge pull request #9425
fc0a4b4 Make wallet2::estimate_fee static (Lee Clagett)
2024-08-13 12:18:24 -04:00
Lee Clagett
fc0a4b4b04 Make wallet2::estimate_fee static 2024-08-07 13:47:31 -04:00
luigi1111
8dbbc47804
Merge pull request #9379
6c28bdb wallet2: move get_rpc_status func to RPC server definition file (j-berman)
2024-07-16 18:58:08 -04:00
luigi1111
c2fceb2939
Merge pull request #9344
a026d5a wallet2: validate fetched block height and parent hash (Oscar Mira)
c634c26 wallet2: use start_height consistently as const in process_parsed_blocks (Oscar Mira)
2024-07-16 18:48:43 -04:00
luigi1111
baf6df06c2
Merge pull request #9343
302fa9b wallet: fetch pool txs in pruned form (jeffro256)
2024-07-16 18:46:04 -04:00
luigi1111
040bccc22f
Merge pull request #9338
4a376d6 copyright: fix vector.h typo (hinto.janaiyo)
d61e8e9 workflows: delete copyright.yml (plowsof)
341771a copyright: bump to 2024 (copyCat)
2024-07-16 18:42:49 -04:00
luigi1111
d7eece3cae
Merge pull request #8619
e71c8bf wallet: background sync with just the view key (j-berman)
2024-07-16 18:29:47 -04:00
Oscar Mira
a026d5ac44
wallet2: validate fetched block height and parent hash 2024-07-05 05:45:28 +02:00
Oscar Mira
c634c261c2
wallet2: use start_height consistently as const in process_parsed_blocks 2024-07-04 13:01:12 +02:00
j-berman
6c28bdb856 wallet2: move get_rpc_status func to RPC server definition file 2024-06-24 17:44:23 -07:00
jeffro256
302fa9b5df
wallet: fetch pool txs in pruned form 2024-05-28 11:19:46 -05:00
j-berman
e71c8bf190 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.
2024-05-24 23:11:58 -07:00
koe
ddf3af1f0c add key exchange round booster to multisig_account 2024-05-21 15:27:08 -05:00
selsta
a28c38c946
wallet2: correct variable usage in get_multisig_seed 2024-05-21 19:22:39 +02:00