Commit graph

9468 commits

Author SHA1 Message Date
Jason Rhinelander 6fcfd0b8ba
Update oxenmq to latest oxen-mq+oxen-encoding
All the encoding parts move to oxen-encoding recently; this updates to
the latest version of oxen-mq, adds oxen-encoding, and converts
everything to use oxenc headers rather than the oxenmq compatibility
shims.
2022-04-14 14:32:01 -03:00
Jason Rhinelander 83ac88e8ab
Replace openssl sha256 implementation with libsodium
Also completely remove the default OPENSSL_init_ssl() call; openssl has
known how to call that itself since 2016.
2022-04-14 14:32:01 -03:00
Jason Rhinelander 82cb6460ac
Merge pull request #1526 from jagerman/wallet2-api-stake-fix
Only return own contributions in listCurrentStakes()
2022-04-14 14:30:17 -03:00
Jason Rhinelander 39e6fdecfc
Merge pull request #1516 from darcys22/wallet2-import-outputs-remove-macro-and-goto
Removes macro and goto code in wallet2::import_outputs function
2022-04-13 20:42:17 -03:00
Jason Rhinelander b5276f0648
Only return own contributions in listCurrentStakes()
This is currently returning all contributions in all service nodes you
are staked to, which causes the mobile wallet to list everyone's stakes
in multi-contribution service nodes as your own.
2022-04-13 19:34:20 -03:00
Sean Darcy 842fe39d83 some lingering references to Loki 2022-02-17 12:02:44 +11:00
Sean Darcy f7bf4be664 Removes macro and goto code in wallet2::import_outputs function
This simply replaces a confusing code section and replaces an odd
macro/goto combination with a more reasonable if statment.
2022-02-11 14:44:50 +11:00
Sean 9588055440
Merge pull request #1467 from jagerman/ledger-speculos
Ledger emulator (speculos) support
2021-11-17 15:58:36 +11:00
Sean Darcy f549e3ffad Add entire range of udev rules 2021-11-05 09:39:16 +11:00
Jason Rhinelander 972fe0de73 Stop using legacy ledger usb product id 2021-11-04 01:35:46 -03:00
Jason Rhinelander 06a9251f15 Add LedgerTCP hardware wallet support
This communicates with the Ledger over TCP, which is what the ledger
emulator requires.

To use, specify:

    --hw-device LedgerTCP --hw-device-address localhost:9999

to the wallet command-line arguments.
2021-11-04 01:35:46 -03:00
Jason Rhinelander b8ecb6724c device: C++ cleanups and modernization
- Clean up a bunch of not very nice C and older C++ code in the
`device/` tree.

- Rename device/device_io_* source files to io_*, and remove their `_io`
suffix from the class names (since they are *already* inside an `io`
namespace).
2021-11-04 01:35:44 -03:00
Jason Rhinelander 7f7caadf4e Add short_duration for single-unit time printing 2021-11-04 01:33:42 -03:00
Jason Rhinelander 25285dacc1 Use fs::path instead of std::filesystem
This uses the ghc filesystem backport when targetting older mac, and
std::filesystem everywhere else.
2021-10-27 10:36:51 -03:00
Jason Rhinelander e312e30f12
Merge pull request #1494 from tewinget/sqlitedb
fix bugs in initial implementation of sqlitedb abstraction
2021-10-19 12:34:33 -03:00
Jason Rhinelander 5a73ec194a
Merge pull request #1495 from jagerman/remove-uselessness
Remove useless atomic calculations
2021-10-19 12:33:35 -03:00
Jason Rhinelander 340c99b524 Set up aes flags properly for cn-turtle compilation 2021-10-18 22:23:01 -03:00
Thomas Winget a255889286 minor fixups in sqlitedb wrapper 2021-10-16 22:32:32 -04:00
Jason Rhinelander ce6050c3d9 And no optimization for apple, too.
It also doesn't compile, because who knows BS with how apple handles
aes, and I hate this cn turtle code.
2021-10-15 20:57:18 -03:00
Jason Rhinelander 290984257f Disable broken intel-optimized build on i386
It doesn't compiler and I can't be arsed to fix it; if someone really
needs 32-bit they probably don't care about performance of turtle
hashing in oxend anyway, so the portable one is fine.
2021-10-15 20:54:12 -03:00
Jason Rhinelander 45e03a4575 Disable LTO for cncrypto on gcc-11
The cn_turtle_hash code makes GCC misoptimization in multiple ways under
LTO, so just force it off for GCC-11 (Hopefully the bugginess gets fixed
by GCC-12).
2021-10-15 20:42:11 -03:00
Jason Rhinelander 62ef3f64b1 Remove useless functions 2021-10-15 19:42:19 -03:00
Thomas Winget e12f8dc518 fix some bugs in sqlitedb abstraction.
also set BUSY timeout for internal sqlite lib to 5 seconds
2021-10-15 17:21:44 -04:00
Jason Rhinelander ee62a23550 Fix x86 arch detection
We were *always* falling back to the software implementation because
this define isn't set here.
2021-10-15 15:19:49 -03:00
Jason Rhinelander 7a70914e15 Split up turtle arch branches
Try to make the code a little more followable.
2021-10-15 14:52:23 -03:00
Jason Rhinelander 69ad37daee Remove useless atomic calculations
These are useless and not used anywhere.  Hurray!
2021-10-15 12:46:32 -03:00
Thomas Winget 640adb7aca fix missing include in sqlitedb
also add "maybe get" function to Database class
2021-10-13 20:29:35 -04:00
Thomas Winget 73e787a9ec sqlitecpp cmake nonsense 2021-10-06 19:36:46 -04:00
Thomas Winget df07ae3e40 require sqlite foreign_key ON 2021-10-04 22:26:33 -04:00
Thomas Winget 435c189a9b sqlitecpp 2021-10-04 20:33:24 -04:00
Sean 578c1c235f
Merge pull request #1484 from jagerman/disable-mms-light
Disable MMS and light wallet support by default
2021-09-06 13:45:16 +10:00
Jason Rhinelander 03add6ebe3 Move operator== into namespace
Argument-dependent lookup will find these if in the same namespace as
Proof itself.
2021-09-03 02:17:07 -03:00
Jason Rhinelander e3999ccb26 Rearrange proof/service node forward declarations to help gcc-8
gcc-8's unique_ptr apparently isn't okay with a forward declared type.
This reverses how proof and service_node_list include/fwd declare each
other to get around it.
2021-09-03 02:15:37 -03:00
Jason Rhinelander 9782155c81
Merge pull request #1481 from jagerman/drop-integration-tests
Drop unmaintained integration test code
2021-09-03 00:28:49 -03:00
Jason Rhinelander e2a7391fb3
Merge pull request #1482 from darcys22/initialise-uptime-proof-info
Initialise uptime proof info
2021-09-03 00:28:30 -03:00
Jason Rhinelander 5759c41291
Merge pull request #1480 from jagerman/logger-rebrand-updates
Fix missing logger rebrand updates
2021-09-03 00:26:34 -03:00
Jason Rhinelander eefd42f93f Add fmtlib::fmt backport of C++20 std::format
Because I'm tired of waiting for std::format.
2021-09-02 17:25:13 -03:00
Jason Rhinelander ff8e2dd09d Disable MMS and light wallet support by default
This aren't used or supported by anyone in Oxen land (as far as I know)
and have not been maintained since the beginning, so hide them behind
disabled-by-default cmake options.

This cuts about 10% off the wallet2 compilation time and 3% off the
simplewallet compilation time, plus gets rid of the page of mms crap in
the cli wallet's "help" screen.
2021-09-02 14:03:19 -03:00
Sean Darcy 36a86af3fc more uptime proof initialisations 2021-08-20 15:42:24 +10:00
Sean Darcy 302259ce69 Uninitialised variables 2021-08-20 15:04:07 +10:00
Jason Rhinelander 5f1bd2f1e4 Drop integration test code.
This code is bitrotting, doesn't compile, and isn't being maintained
anymore.

The integration test suite was an interesting idea, in early Loki days,
but is no longer being maintained and is quite cumbersome to run (for
instance, it is not possible to run it via CI because it depends on
xterm to actually run).  The code to actually run it (in doy-lee's
loki-integration-testing repository) is also a large burden of "janky"
code that isn't worth maintaining.

Remove this from the code; if someone wants to pick it back up in the
future reverting this commit shouldn't be too difficult (though I'd
suggest that a much better approach to integration testing would be to
run different daemons/wallets via rpc commands, as the network-tests do,
rather than trying to feed stdin and parse stdout from running
individual oxends/wallets).
2021-08-19 16:42:15 -03:00
Jason Rhinelander 5b95224c39 Fix some missing LOKI -> OXEN logger defines
Various ones were unchanged in epee.

Also found a couple very old MONERO -> OXEN changes as well.
2021-08-19 16:03:32 -03:00
Jason Rhinelander 16c15c5d26
Merge pull request #1466 from jagerman/wallet-api-refresh-locks
Add locks around the refresh thread
2021-08-09 22:39:46 -03:00
Sean Darcy ff1b25c961 Explanatory message for workaround 2021-07-09 16:02:13 +10:00
Jason Rhinelander 381a3a4ecd Fix hard_fork_info rpc returning wrong earliest_height
With multiple forks on the same major version `get_hard_fork_heights`
was returning the last one instead of the first one.
2021-07-09 02:55:47 -03:00
Sean Darcy 84f6d08baa Allow HF18 to be used earlier
The get earliest version returns HF 18.1 and this means that our blink
fees that were enabled in HF18 are no longer accepted. Push through to
allow the fees to be used 4000 blocks earlier (current height)
2021-07-09 15:29:06 +10:00
Jason Rhinelander d8662ace7b Add non-blocking isRefreshing(); make height retrieval non-blocking 2021-07-07 18:10:29 -03:00
Jason Rhinelander e09b23a143 Make pointer const 2021-07-07 11:05:17 -03:00
Jason Rhinelander 81eddcd26a Add locks around the refresh thread
Wallet API is really messy with threads -- the refresh thread can run at
any time and change internal wallet state which breaks just about
everything.

This puts all non-trivial wallet access from wallet_api behind a lock of
the refresh thread to lock it out from refresh while other operations
are underway.
2021-07-07 11:05:17 -03:00
Jason Rhinelander 4f6f67d151 Fix segfault triggered in test suite on macos
It seems that the `m_tinfo` can be null, sometimes, when `m_cursors ==
&m_wcursors` is true, and the upstream Monero code (which is pure macro)
doesn't touch the bool in such a case.

For some reason this started segfaulting now, only on macos, only on a
release build because of the access into `m_tinfo`.

The workaround (which is indeed a correct fix) appears to avoid the
segfault, but the segfault could retrigger if that invariant doesn't
hold (and it isn't immediately obvious why that invariant *should*
hold).

This, like pretty much all of the LMDB code, is garbage.
2021-07-06 17:37:01 -03:00