Commit Graph
100 Commits
Author SHA1 Message Date
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 57c40b8993 functional_tests: fix piecemeal export in cold_signing, part 2
Do not mark output import as done if exception is thrown for output being past last imported output.
2025-08-26 15:38:25 -05:00
jeffro256 22433f8414 functional_tests: fix piecemeal export in cold_signing
The `while` loop condition was incorrect, which could lead to incomplete imports.
Also, setting `start` to an *undone* output speeds up the test by 16s on my machine.
2025-08-22 13:21:32 -05:00
jeffro256 78b8c83fdf functional_tests: check transfers list consistency in cold_signing 2025-08-21 11:34:58 -05:00
jeffro256 a5b2ad04c5 BlockchainLMDB: do not assume alignment for alt block entries 2025-08-20 23:23:48 -05:00
jeffro256 613ee85402 cryptonote_basic: remove state_idle in connection_context 2025-08-07 20:55:44 -05:00
jeffro256andj-berman 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
jeffro256 377071ea89 cryptonote_core: remove blockchain_storage_boost_serialization.h
unused
2025-07-24 02:22:14 -05:00
jeffro256 5e54c72629 wallet: RPC method /incoming_transfers without daemon connection
Allows calling /incoming_transfers for cold wallets especially
2025-07-24 01:51:06 -05:00
jeffro256 a2f336d22f serialization: massage pair casting to remove user-defined-cast warnings
Similar to: https://github.com/sstsimulator/sst-core/pull/1315
2025-07-16 00:03:42 -05:00
jeffro256 2820757d9d common: remove tools::add_element
Since C++17, `std::vector::emplace_back()` returns a reference, so this helper isn't needed anymore.
2025-07-11 11:31:46 -05:00
jeffro256 3c05f00b85 crypto: check+throw for Cryptonight v1 invalid input
If `crypto::cn_slow_hash()` is called with `variant=1` and an input length of less thab 43 bytes, it triggers a program exit.
This checks first and throws an exception instead.

Thank you to ADA Logics and the MAGIC Monero Fund for reporting this!
2025-07-11 11:19:43 -05:00
jeffro256 6131ddef10 rpc: return error correctly on bad key image string
Because of the missing `return` statement, the status is set to "OK" later on in the method when it shouldn't be.

Thank you to ADA Logics and the MAGIC Monero Fund for reporting this!
2025-07-11 10:39:03 -05:00
jeffro256andnahuhh 6d06de74b2 wallet: refactor subaddress expansion & add to transfer test 2025-07-07 22:16:11 +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
4c341da1e5 BlockchainLMDB: remove virtual qualifers from overriden methods and mark final
According to guideline at https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines.html#c128-virtual-functions-should-specify-exactly-one-of-virtual-override-or-final

Co-authored-by: SNeedlewoods <sneedlewoods_1@protonmail.com>
Co-authored-by: Lee *!* Clagett <code@leeclagett.com>
2025-05-30 12:11:43 -05:00
jeffro256 6fd3a2e06b tools::variant: remove 2025-05-15 13:48:36 -05:00
jeffro256 deb1ec93c8 BlockchainLMDB: mark overridden methods with override 2025-05-15 13:13:39 -05:00
jeffro256 0db4ed059e gpg_keys: bump jeffro256 expiration to 2027-05-09 2025-05-08 19:11:54 -05:00
jeffro256 06b74ae3f5 ringct & cryptonote_basic: detangle dependencies
`libringct` was linking against `libcryptonote_basic` for a single, one-line convenience function: `cryptonote::get_blob_hash`.
Since `cryptonote_basic.h` includes `rctTypes.h`, this one function effectively made an explicit circular dependency between
the two libraries. `cryptonote_format_utils.cpp` was including header `rctSigs.h` from `libringct`, when only `rctOps.h` from
`libringct_basic` needed to be included. `libcryptonote_basic` wasn't explictly linking against `libringct_basic` nor
`libringct` like it should have. And `libblockchain_db` wasn't linking against `libcryptonote_basic` like it should have. We
can also downgrade `libblockchain_db`'s dependency on `libringct` to `libringct_basic`.
2025-05-07 19:52:24 -05:00
jeffro256 98b79485df msys2 build: include int headers 2025-04-29 00:57:37 -05:00
jeffro256 7cb406e05a cryptonote_basic: is_coinbase() take prefix
Useful for wallet business logic, which stores the prefixes in `m_transfers`, not the whole transaction.
2025-04-02 11:01:49 -05:00
jeffro256 7b28be0ef3 functional_tests: test PR #9863 2025-04-01 13:56:44 -05:00
jeffro256 8af33c71cf epee: syncobj: replace shims with Boost classes
a. `critical_section` is functionally identical to a `boost::recursive_mutex`
b. `critical_region_t` is functionally identical to a `boost::unique_lock`
c. remove some vestigial definitons `g_test_dbg_lock_sleep` as a variable
2025-04-01 11:09:26 -05:00
jeffro256 18376ca57d epee: remove reg_exp_definer.h
Locking to initialize static block variables isn't necessary since C++11:
https://en.cppreference.com/w/cpp/language/storage_duration#Static_block_variables
2025-03-31 14:02:15 -05:00
jeffro256 f728c963c1 CMakeLists: add cache option for MANUAL_SUBMODULES 2025-03-28 13:14:06 -05:00
jeffro256 6d6e8e1733 construct_tx_and_get_tx_key: don't erase exception trace 2025-03-26 15:10:09 -05:00
jeffro256 332d92ffbe epee: span::operator[] allow mut ref from const span
Changes the `operator[]` method so we can get mutable
references to elements even if the span is `const`.
The operator is now also `constexpr`.
This behavior matches `std::span`.

C++ standard reference: https://en.cppreference.com/w/cpp/container/span/operator_at
2025-03-22 16:53:17 -05:00
jeffro256 51a72c1209 Blockchain: remove skip for pruned txs in check_tx_inputs()
I can't see how this would trigger in the current codebase, so it's not a *current* safety issue,
but I can very well see it becoming on in the future if downstream code doesn't handle the passing
of pruned transactions correctly. I think the safe/good choice would be to remove this skip now
that all transactions that pass into the mempool are supposed to be unpruned. And for all in-block
txs, `check_tx_inputs()` isn't called for checkpointed blocks, and we sync pruned blocks only if
syncing checkpointed blocks.
2025-03-17 09:31:50 -05:00
jeffro256 528664b1c8 cryptonote_protocol: fix handling of pruned blocks during sync 2025-03-17 09:09:25 -05:00
jeffro256 5393bef139 wallet: fix different-signedness int comparison warnings 2025-03-13 04:10:29 -05:00
jeffro256 c069c04ede blockchain sync: reduce disk writes from 2 to 1 per tx 2025-03-10 01:02:37 -05:00
jeffro256 418a9adb13 BlockchainLMDB: fix data.mdb nuking on Windows 2025-02-17 11:57:32 -06:00
jeffro256 9386f87a78 ringct: remove inclusion of cryptonote_format_utils.h in rctOps.cpp
This vestigial include line breaks some downstream builds
2025-01-31 16:04:08 -06:00
jeffro256 70e4412930 wallet: mark wallet error throwing functions as noreturn
Simplifies calling logic where a branch ends but a return value is needed
2025-01-28 00:05:31 -06:00
jeffro256 ff4e86dc4f ringct: remove unused range proof types and fix serialization bug 2025-01-18 23:40:19 -06:00
jeffro256 254ac2baef crypto: make CRYPTO_DEFINE_HASH_FUNCTIONS adhere strict aliasing
This code could've caused issues if the pointer to the `public_key`, `key_image`, `hash`, etc wasn't aligned on an 8-byte boundary.
2025-01-09 11:58:39 -06:00
jeffro256 d64d3bd530 p2p: remove dead protocol defs 2024-12-27 15:22:19 -06:00
jeffro256andMike c99c07bf4a common/password: flush confirm prompt before user input
Co-authored-by: Mike <mpech@tuta.io>
2024-12-26 13:32:11 -06:00
jeffro256 f84f237af7 unit_tests: fix variant tests after 'optional' name split 2024-12-24 13:55:18 -06:00
jeffro256 fe170698b1 Blockchain: get height of RingCT fork programmatically
Get height of the RingCT fork to start the output distributuon programmatically, instead of using a hardcoded index.

If using a hardcoded index, when the hardfork tables are modified, this can cause segmentation faults or horrific privacy issues: https://codeberg.org/wownero/wownero/issues/488#issuecomment-2514880.
2024-12-16 15:16:38 -06:00
jeffro256 b5f29eeacd p2p: allow comments in banlist files
In-line comments explicitly explaining banned hosts/subnets might help assuage fears of some good banlists' arbitaryiness.
2024-12-12 23:48:06 -06:00
jeffro256 eb6f12c213 serialization: silence warning about shifting uint8_t by 8
Some compilers are stupid and give a warning on this line when `T = uint8_t`, even though it will never run
2024-11-08 15:06:32 -06:00
jeffro256andj-berman c7dce222f8 ringct: add operator!= for key
Part of upstreaming Seraphis/Carrot

Co-authored-by: j-berman <justinberman@protonmail.com>
2024-11-06 03:01:48 -06:00
jeffro256 c1ead13df3 wallet2_api: use std::optional instead of handmade optional
Cleaner, adheres to POLA, and allows for better compiler optimization. Declaration should be backwards compatible. Requires C++17.
2024-10-30 13:04:30 -04:00
jeffro256 0f9a5c1020 crypto: remove unused OAES code
@SyntheticBird45 reported that the OpenBSD compiler gives warnings about string functions used in `oaes_sprintf`,
as well as use of `rand()` in `oaes_key_gen`. Neither of these functions are used in the codebase. Removing the
unused OAES functions silences these warnings.
2024-10-07 11:04:34 -05:00
jeffro256 89777469f1 tests: include <iomanip> where using std::setfill 2024-10-07 00:50:45 -05: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
jeffro256 59cddbb9ca serialization: support passing extra args to fields in DSL
This PR is upstreaming changes in the Seraphis lib here: https://github.com/UkoeHB/monero/pull/39. The changes to the serialization header allow clean passing
of extra arguments to field serialization in the DSL. This is used mainly to pass implied sizes of containers during deserialization to make the format more
compact. For example, if my object has two containers A & B which must be the same size, I can serialize only the size of container A. Then, during
deserialization, when I deserialize A, I can then use A's size to deserialize B.

Depends on #9286.
2024-08-13 12:05:24 -05:00
jeffro256 b2c59c498c common: add va_args.h
This PR is upstreaming changes in the Seraphis lib here: https://github.com/UkoeHB/monero/pull/39. This header adds a macro `VA_ARGS_COMMAPREFIX`
which, when passed `__VA_ARGS__`, expands to `, __VA_ARGS__` unless the length of `__VA_ARGS__` is 0, in which case it expands to nothing. This
macro is useful for passing/declaring optional function arguments.
2024-08-13 12:02:45 -05:00
jeffro256 ac0af73222 rpc: add cumul weight field to block template resp
Resolves #9415
2024-08-01 01:03:41 -05:00
jeffro256 7fdaf61d41 Blockchain: fix temp fails causing alt blocks to be permanently invalid 2024-07-11 00:43:38 -05:00
jeffro256 302fa9b5df wallet: fetch pool txs in pruned form 2024-05-28 11:19:46 -05:00
jeffro256 b07a97c51f epee: partially revert c56ee140 to fix linking errors
On Linux Mint 21.3, g++ Ubuntu 11.4.0-1ubuntu1~22.04, I get linking error for an undefined reference to `epee::string_tools::trim_right`. This PR reverts the changes
to epee_readline.cpp in commit c56ee140, which turns a `boost::trim_right` callsite into an `epee::string_tools::trim_right` callsite.
2024-05-28 10:37:48 -05:00
jeffro256 004ead1a14 gpg_keys: renew jeffro256
Expiration date is simply pushed back to 1 year from now.
2024-05-14 13:34:13 -05:00
jeffro256 025021dee0 BlockchainDB: shorter fixup()
Instead of hard-coding all missing key images into the code and inserting if missing,
we simply pop all blocks after height 202611. This makes the `monerod` binary about
0.35% smaller.
2024-04-11 14:34:56 -05:00
jeffro256 262ef473db BlockchainDB: remove lock/unlock methods 2024-04-11 12:12:35 -05:00
jeffro256 bc05e724cb common: add va_args.h
This PR is upstreaming changes in the Seraphis lib here: https://github.com/UkoeHB/monero/pull/39. This header adds a macro `VA_ARGS_COMMAPREFIX`
which, when passed `__VA_ARGS__`, expands to `, __VA_ARGS__` unless the length of `__VA_ARGS__` is 0, in which case it expands to nothing. This
macro is useful for passing/declaring optional function arguments.
2024-04-11 11:32:07 -05:00
jeffro256 ff49444ee8 @tobtoht: undo rebase changes tx.dsts -> tx_dsts 2024-04-05 13:12:34 -05:00
jeffro256 d6609b83d6 serialization: do any N-tuple 2024-03-19 14:49:36 -05:00
jeffro256 8e80585ef5 functional_tests: test HTTP digest auth
Test:
  1. Can't login to RPC server with --rpc-login enabled, but no auth provided
  2. Can access RPC server with correct login
  3. Can use internal HTTP client to access RPC server with correct login

With commit 0ae5c91e50 not reverted, we fail test 3.
2024-03-11 23:54:50 -05:00
jeffro256 c4e1c5a640 ringct: fix trunc_amount field name change
Caused in commit 05231400ce, PR #9035.
2024-03-11 20:21:22 -05:00
jeffro256 bcb15d3b00 Revert "http_client: reduce number of packets sent for small bodies"
This reverts commit 0ae5c91e50.
2024-03-10 23:04:44 -05:00
jeffro256 9d101d5ea0 serialization: protect blob serialization from undefined behavior
There is currently no compiler protection when someone tries to
do (for example) `BLOB_SERIALIZER(std::vector<int>)`. You just
get runtime allocation errors. This has already eaten up dev time
before, so this PR adds a static assertion that the type must be
trivially copyable, as defined by the C++ standard. Types can
override this if applicable if they use `BLOB_SERIALIZER_FORCED`.
2024-03-10 14:15:48 -05:00
jeffro256 7194506792 Blockchain: remove old fee calc logic 2024-03-10 13:30:46 -05:00
jeffro256 7815023117 tx_memory_pool: make double spends a no-drop offense
Nodes who see different txs in a double spend attack will drop each other, splitting the network.
Issue found by @boog900.
2024-03-07 09:23:51 -06:00
jeffro256 399b884a9c unit_tests: fix strtoul unit test 2024-03-07 09:05:09 -06:00
jeffro256 38f354e89f Enforce Tx unlock_time is Zero by Relay Rule
Related to https://github.com/monero-project/research-lab/issues/78

Added a relay rule that enforces the `unlock_time` field is equal to 0 for non-coinbase transactions.

UIs changed:
* Removed `locked_transfer` and `locked_sweep_all` commands from `monero-wallet-cli`

APIs changed:
* Removed `unlock_time` parameters from `wallet2` transfer methods
* Wallet RPC transfer endpoints send error codes when requested unlock time is not 0
* Removed `unlock_time` parameters from `construct_tx*` cryptonote core functions
2024-02-24 14:27:17 -06:00
jeffro256 2a2da79943 free function serialization DSL
Example usage for Seraphis types (in global or `sp` namespace):

```
BEGIN_SERIALIZE_OBJECT_FN(sp::SpCoinbaseEnoteCore)
    FIELD_F(onetime_address)
    VARINT_FIELD_F(amount)
END_SERIALIZE()

BEGIN_SERIALIZE_OBJECT_FN(sp::SpEnoteCore)
    FIELD_F(onetime_address)
    FIELD_F(amount_commitment)
END_SERIALIZE()
```
2024-02-24 11:24:47 -06:00
jeffro256 b13c5f6669 wallet: feature: transfer amount with fee included
To transfer ~5 XMR to an address such that your balance drops by exactly 5 XMR, provide a `subtractfeefrom` flag to the `transfer` command. For example:

    transfer 76bDHojqFYiFCCYYtzTveJ8oFtmpNp3X1TgV2oKP7rHmZyFK1RvyE4r8vsJzf7SyNohMnbKT9wbcD3XUTgsZLX8LU5JBCfm 5 subtractfeefrom=all

If my walet balance was exactly 30 XMR before this transaction, it will be exactly 25 XMR afterwards and the destination address will receive slightly
less than 5 XMR. You can manually select which destinations fund the transaction fee and which ones do not by providing the destination index.
For example:

    transfer 75sr8AAr... 3 74M7W4eg... 4 7AbWqDZ6... 5 subtractfeefrom=0,2

This will drop your balance by exactly 12 XMR including fees and will spread the fee cost proportionally (3:5 ratio) over destinations with addresses
`75sr8AAr...` and `7AbWqDZ6...`, respectively.

Disclaimer: This feature was paid for by @LocalMonero.
2024-02-20 17:08:06 -06:00
jeffro256 49ca1ad6ae variant: split into variant and optional_variant
Upstreaming https://github.com/UkoeHB/monero/pull/28
2024-02-16 19:12:13 -06:00
jeffro256 48b7d0895a epee binary: container can read from empty seq of any type 2024-02-16 15:53:07 -06:00
jeffro256 62fdacca07 variant: visit lambda and value-initialize by index 2024-02-14 02:01:44 -06:00
jeffro256 8d25418df0 daemon: warn user on specifiying ZMQ args with --no-zmq
Resolves https://github.com/monero-project/monero/issues/9127
2024-02-07 00:04:46 -06:00
jeffro256and0xFFFC0000 e7629dc46f CMake: only set policy CMP0148 to OLD if version >= 3.27
Co-authored-by: 0xFFFC0000 <0xFFFC0000@proton.me>
2024-01-19 11:14:58 -06:00
jeffro256 0c545f614a epee/test: remove levin_protocol_handler and core_proxy tests 2024-01-17 17:17:16 -06:00
jeffro256 a79734c848 cryptonote_basic: faster and more readable is_valid_decomposed_amount
Includes performance tests
2024-01-15 15:44:10 -06:00
jeffro256 afe5167531 depends: update config scripts
The files are exact copies from the original repository (git://git.savannah.gnu.org/config.git),
in commit 28ea239c53a2d5d8800c472bc2452eaa16e37af2. The main reason for the update is because
loongarch was mentioned in PR #9114 and new the latest config files handle loongarch,
as well as WASM64, since the old files only cover WASM32. Tandem NSX and IA16, are also handled
in the newest config files, which covers the changes TheCharlatan made in 2018.
2024-01-12 12:54:26 -06:00
jeffro256 2525200185 serialization: remove container wrappers and serialize directly
Some downstream code (most notably PR https://github.com/UkoeHB/monero/pull/25) wants to use the src/serialization lib
for storing information persistently. When one builds classes/machines wishing to serialize containers, they must use
the `serializable_*` container classes. In this case, this makes the Seraphis library code unnecessarily tightly coupled
with the src/serialization code since one cannot swap out their type of storage format without major refactoring of class
field types. By serializing STL containers directly, we can abstract the serialization details away, making for much
cleaner design. Also small bonus side effect of this change is that STL containers with custom Comparators, Allocators,
and Hashers are serializable. `std::multimap` is added to the list of serializable containers.

Depends upon https://github.com/monero-project/monero/pull/9069.
2023-11-28 14:06:24 -06:00
jeffro256 a11e03afa6 serialization: fix infinite loops and clean up dispatching
Resolves #8687
2023-11-18 03:47:55 -06:00
jeffro256 23179a0ba4 wallet: fix multisig key memory leak
Multisig keys per-transfer were being wiped, but not erased, which lead to a ginormous
quadratic bloat the more transfers and exports you performed with the wallet.
2023-11-02 02:58:50 -05:00
jeffro256 504269e6cf unit tests: fix running from pwd and auto test selected location 2023-10-28 03:14:05 -05:00
jeffro256 e191083bed epee: remove dead code in math_helper and string_tools 2023-10-25 16:41:21 -05:00
jeffro256 05231400ce ringct: make rctSigBase serialization follow strict aliasing rule
Accessing an object of type `char` thru an lvalue of type `crypto::hash8` is undefined behavior.
https://developers.redhat.com/blog/2020/06/03/the-joys-and-perils-of-aliasing-in-c-and-c-part-2
2023-10-23 16:28:02 -05:00
jeffro256 56dab0fad2 cryptonote_config: include cstdint
Header was using `uint64_t` without including `<cstdint>` which caused some issues downstream for windows builds
2023-10-22 18:02:54 -05:00
jeffro256 30cf537bcc unit tests: wallet_storage: generate in "Ascii" format test 2023-10-21 18:37:12 -05:00
jeffro256 b2eb47d875 wallet: mitigate statistical dependence for decoy selection within rings
Since we are required to check for uniqueness of decoy picks within any given
ring, and since some decoy picks may fail due to unlock time or malformed EC points,
the wallet2 decoy selection code was building up a larger than needed *unique* set of
decoys for each ring according to a certain distribution *without replacement*. After
filtering out the outputs that it couldn't use, it chooses from the remaining decoys
uniformly random *without replacement*.

The problem with this is that the picks later in the picking process are not independent
from the picks earlier in the picking process, and the later picks do not follow the
intended decoy distribution as closely as the earlier picks. To understand this
intuitively, imagine that you have 1023 marbles. You label 512 marbles with the letter A,
label 256 with the letter B, so on and so forth, finally labelling one marble with the
letter J. You put them all into a bag, shake it well, and pick 8 marbles from the bag,
but everytime you pick a marble of a certain letter, you remove all the other marbles
from that bag with the same letter. That very first pick, the odds of picking a certain
marble are exactly how you would expect: you are twice as likely to pick A as you are B,
twice as likely to pick B as you are C, etc. However, on the second pick, the odds of
getting the first pick are 0%, and the chances for everything else is higher. As you go
down the line, your picked marbles will have letters that are increasingly more unlikely
to pick if you hadn't remove the other marbles. In other words, the distribution of the
later marbles will be more "skewed" in comparison to your original distribution of marbles.

In Monero's decoy selection, this same statistical effect applies. It is not as dramatic
since the distribution is not so steep, and we have more unique values to choose from,
but the effect *is* measureable. Because of the protocol rules, we cannot have duplicate
ring members, so unless that restriction is removed, we will never have perfectly
independent picking. However, since the earlier picks are less affected by this
statistical effect, the workaround that this commit offers is to store the order that
the outputs were picked and commit to this order after fetching output information over RPC.
2023-10-17 00:53:40 -05:00
jeff 80b5bf8b3d gcc: fix uninitialized constructor warnings 2023-10-16 16:48:27 -05:00
jeff 9f981ac219 wallet: store watch-only wallet correctly when change_password() is called
The Monero GUI code was calling `Monero::wallet::setPassword()` on every open/close for some reason,
and the old `store_to()` code called `store_keys()` with `watch_only=false`, even for watch-only wallets.
This caused a bug where the watch-only keys file got saved with with the JSON field `watch_only` set to 0,
and after saving a watch-only wallet once, a user could never open it back up against because `load()` errored out.
This never got brought up before this because you would have to change the file location of the watch-only
wallet to see this bug, and I guess that didn't happen often, but calling the new `store_to()` function with the
new `force_rewrite` parameter set to `true` triggers key restoring and the bug appeared.
2023-09-21 22:42:16 -05:00
jeff 1025e4fcb1 unit_test: set data dir relative to exe & add log-level arg 2023-09-10 02:18:50 -05:00
jeffro256 1bea8ef42a wallet2: fix store_to() and change_password()
Resolves #8932 and:
2. Not storing cache when new path is different from old in `store_to()` and
3. Detecting same path when new path contains entire string of old path in `store_to()` and
4. Changing your password / decrypting your keys (in this method or others) and providing a bad original password and getting no error and
5. Changing your password and storing to a new file
2023-08-23 11:48:18 -05:00
jeffro256 d4d884057c functional_tests: fix multisig tests noutputs assertion
The changes to the multisig tests in #8914 and #8904 affected each other, this PR cleans up the code and fixes that issue.
2023-08-19 22:09:51 -05:00
jeffro256 8190f2532b KV_SERIALIZE: remove extraneous semicolons in DSL
Prereq of https://github.com/monero-project/monero/pull/8867
2023-08-10 11:13:14 -05:00
jeffro256 f71e2dcdc8 multisig: better errors for small malformed kex msgs
Resolves https://github.com/monero-project/monero/issues/8493
2023-08-08 12:01:40 -05:00
jeffro256 1e2e7035e9 core_rpc_server: silence unused warnings 2023-08-01 17:46:34 -05:00
jeffro256andACK-J b0bf49a65a blockchain_db: add k-anonymity to txid fetching
Read more about k-anonymity [here](https://en.wikipedia.org/wiki/K-anonymity). We implement this feature in the monero daemon for transactions
by providing a "Txid Template", which is simply a txid with all but `num_matching_bits` bits zeroed out, and the number `num_matching_bits`. We add an operation to `BlockchainLMDB` called
`get_txids_loose` which takes a txid template and returns all txids in the database (chain and mempool) that satisfy that template. Thus, a client can
ask about a specific transaction from a daemon without revealing the exact transaction they are inquiring about. The client can control the statistical
chance that other TXIDs (besides the one in question) match the txid template sent to the daemon up to a power of 2. For example, if a client sets their `num_matching_bits`
to 5, then statistically any txid has a 1/(2^5) chance to match. With `num_matching_bits`=10, there is a 1/(2^10) chance, so on and so forth.

Co-authored-by: ACK-J <60232273+ACK-J@users.noreply.github.com>
2023-08-01 17:25:25 -05:00
jeffro256 45b52de28e wallet-rpc: restore from multisig seed 2023-07-28 12:17:14 -05:00
jeffro256 192d87cd24 remove more 'using namespace' statements from headers 2023-07-18 22:46:43 -05:00
jeffro256 a0e5c3c326 wallet2: when checking frozen multisig tx set, don't assume order 2023-07-16 13:29:52 -05:00
jeffro256 ffbf9f4766 blockchain_and_pool: move to crytonote_core and enforce its usage 2023-07-01 07:12:53 -05:00