Commit Graph

19 Commits

Author SHA1 Message Date
Jason Rhinelander f382c1971e
Replace hook virtual calls with std::function
- Instead of inheriting from a pure virtual base class, we know just use
  lambdas for hook callbacks.
- The signature of hooks also changes to take an info struct rather than
  a list of parameters, so that you don't have to change everything to
  ignore unwanted parameters if someone adds something to a hook.
2022-07-27 14:20:29 -03:00
Jason Rhinelander dfe566480b
Remove cryptonote_config macros
- Replace all cryptonote_config macros with constexpr variables.  Some
  become integer types, some become chrono types.
  - generally this involved removing a "CRYPTONOTE_" prefix since the
    values are now in the `cryptonote` namespace
  - some constants are grouped into sub-namespaces (e.g.
    cryptonote::p2p)
  - deprecated constants (i.e. for old HFs) are in the `cryptonote::old`
    namespace.
  - all the magic hash key domain separating strings are now in
    cryptonote::hashkey::WHATEVER.
- Move some economy-related constants to oxen_economy.h instead
- Replaced the BLOCKS_EXPECTED_IN_DAYS constexpr functions with more
  straightforward `BLOCKS_PER_DAY` value (i.e.  old
  `BLOCKS_EXPECTED_IN_DAYS(10)` is now `BLOCKS_PER_DAY * 10`.
- Replaced `network_version` unscoped enum with a scoped enum
  `cryptonote::hf`, replacing all the raw uint8_t values where it was
  currently accepted with the new `hf` type.
- Made `network_type` a scoped enum so that it now has to be qualified
  (network_type::TESTNET) and can't be arbitrarily/unintentionally
  converted to/from an int.
- HARDFORK_WHATEVER macros have become cryptonote::feature::WHATEVER
  constexpr hf values.
- Add `revision` to rpc hard_fork_info response
- Don't build trezor code at all (previously we were pointlessly
  building an empty dummy lib).
2022-05-16 20:37:07 -03:00
Sean Darcy 90232dd217 shorten wire names 2021-02-09 11:54:27 +11:00
Jason Rhinelander 05f0572155 Replace loki::clamp_u64 backport with std::clamp 2020-07-02 12:52:13 -03:00
Jason Rhinelander 85eea97a7a Address missing `override` warnings 2020-06-14 23:55:48 -03:00
Doyle 788603caaa Distinguish pop_blocks from reorg in detach hook 2019-10-16 10:25:04 +11:00
Doyle add6051a8f
make get_checkpoints_range faster by using lmdb cursor as iterator (#819)
* make get_checkpoints_range faster by using lmdb cursor as iterator

* Update clamp to be more compliant with convention
2019-08-30 13:54:49 +10:00
Doyle b6f24d7fb0
Fix checkpoint regression, must accept alt blocks if they are < the first checkpoint (#792) 2019-08-13 15:33:20 +10:00
Doyle 73e8ac0343
Service Node Checkpoint Storage (#579)
* Add functions for storing checkpoints to the DB

* Allocate the DB entry on the stack instead of heap

* Add virtual overrides for new checkpoint functions

* Clean up for pull request, simplify some logic

* Revise API to include height in checkpoint header

* Move log to top of function even if early exit

* Begin moving checkpoints to db

* Allow storing of checkpoints to DB

* Cleanup for code reviewer, fix unit tests

* Fix tests, fix casting issues

* Don't use DUPSORT, use height->checkpoint mapping in DB

* Remove if 0 disabling checkpoint vote, we already check HF12

* Fix unit test infinite loop

* Update db schemas to match blk_checkpoint_header

* Code review
2019-05-01 15:57:41 +10:00
xmr-eric 18216f19dd Update 2018 copyright 2018-01-26 10:03:20 -05:00
moneromooo-monero 5d65a75b69
move checkpoints in a separate library 2017-09-25 21:16:26 +01:00
Riccardo Spagni c3599fa7b9
update copyright year, fix occasional lack of newline at line end 2017-02-21 19:38:18 +02:00
kenshi84 8027ce0c75 extract some basic code from libcryptonote_core into libcryptonote_basic 2017-02-08 22:45:15 +09:00
moneromooo-monero 89e68d778d
unit_tests: check adding checkpoints succeeded 2016-07-26 22:40:38 +01:00
Riccardo Spagni de03926850
updated copyright year 2015-12-31 08:39:56 +02:00
moneromooo-monero 44f1267a39
tests: fix a typo in test name 2015-12-13 11:10:33 +00:00
Riccardo Spagni f4b69d553a
year updated in license 2015-01-02 18:52:46 +02:00
fluffypony 6fc995fe5d License updated to BSD 3-clause 2014-07-23 15:03:52 +02:00
mydesktop 8d4320b201 add checkpoints.cpp in unit tests 2014-05-25 13:35:54 -04:00