The functions in src/cryptonote_core/checkpoints_create.{h,cpp} should
be member functions of the checkpoints class, if nothing else for the
sake of keeping their documentation together.
This commit covers moving those functions to be member functions of the
checkpoints class as well as documenting those functions.
All functions in src/cryptonote_core/checkpoints.h are now documented in
doxygen style.
checkpoints.cpp has been reviewed, one function has been marked for
discussion on correctness.
- Blockchain should store if it's running on testnet or not
- moved loading compiled-in block hashes to its own function for clarity
- on handle_get_objects, should now correctly return false if a block's
transactions are missing
- replace instances of BOOST_FOREACH with C++11 for loops in Blockchain.
d1c3c3b blockchain: on hardfork 2, require mixin 2 at least if possible (moneromooo-monero)
82a38d0 hardfork: make the voting window a week (moneromooo-monero)
4cf3028 hardfork: rescan speedup (moneromooo-monero)
d923639 hardfork: remove use of GNU extension for initializing object (moneromooo-monero)
969c2c8 blockchain: on hardfork 2, allow miners to claim less money than allowed (moneromooo-monero)
a803bef hardfork: change window semantics to not count the newly added block (moneromooo-monero)
9fa0f4a blockchain: use different hard fork settings for testnet and mainnet (moneromooo-monero)
8d67a9a tests: remove leftover debug traces in hardfork test (moneromooo-monero)
This allows knowing the hard fork a block must obey in order to be
added to the blockchain. The previous semantics would use that new
block's version vote to determine this hard fork, which made it
impossible to use the rules to validate transactions entering the
tx pool (and made it impossible to validate a block before adding
it to the blockchain).
All functions are now documented in doxygen format. Comments have been
updated to reflect the current state of the code. Many areas for
improvement in clarity and design have been noted, as well as cruft to
be removed. These changes are not reflected in this commit both to
allow time for comment and to keep commits organized by purpose.
5b11a89 hardfork: most state now saved to the DB (moneromooo-monero)
0a54c3a hardfork: remove the "parts are copyright cryptonote" notices (moneromooo-monero)
e546f37 Add an RPC call and daemon command to get info on hard fork voting (moneromooo-monero)
d067131 blockchain: force a hardfork recalculation at load time (moneromooo-monero)
a717761 core: add consts where appropriate (moneromooo-monero)
8ffc508 core: moan when we think an update is needed to get latest hard fork info (moneromooo-monero)
f854984 blockchain: use the new hardfork class (moneromooo-monero)
62b1f74 New hardfork class (moneromooo-monero)
bed9a44 blockchain: add a couple missing includes (moneromooo-monero)
- make error constants actually const
- fix client leak when reconnecting after failure to connect
- simplify strncpy bound
- fix user controlled memory writes in getheight
93aadbd unit_tests: initialize a field to silence a valgrind report (moneromooo-monero)
b0a98b2 unit_tests: initialize enough to silence valgrind (moneromooo-monero)
555d90b berkeleydb: fix delete/free mismatch (moneromooo-monero)
008a54d blockchain: change code to mirror original CN code (moneromooo-monero)
0c85237 blockchain: fix return value on out of range start offset (moneromooo-monero)
a474d66 blockchain: fix offset/height comparisons in get_blocks (moneromooo-monero)
d28ca8e blockchain: make some flag setting code closer to the original code (moneromooo-monero)
d166113 blockchain: rework loop to match the original code in complete_timestamps_vector (moneromooo-monero)
4707ccf blockchain: fix sizing of timestamps and cumulative_difficulty vectors (moneromooo-monero)
5e3d56d blockchain: match original code's error return in switch_to_alternative_blockchain (moneromooo-monero)
a33dcdd blockchain: fix rollback height in failure path (moneromooo-monero)
1208cc8 blockchain: match original code early out in rollback_blockchain_switching (moneromooo-monero)
Some word triplets, such as "mugged names nail", are not valid
results from any 32 bit value. If used to decode a 32 bit value,
the result will therefore encode to a different word triplet.
Fix this by using random words converted from an actual random
bitstring, ensuring we always get valid triplets.
A memory chunk is split in two, and the concatenation of the
two parts compared to the original, triggering a comparison
with uninitialized (with a copy of itself, but valgrind does
not realize that).