In #15848, darosior fixed up a comment which mis-identified the units of a constant.
Another comment misidentified a value as in MiB rather than MB.
100 MiB is 100 * (10224 ** 2), or 107,374,182,400 bytes.
48 | @@ -49,7 +49,7 @@ extern std::atomic_bool fReindex; 49 | /** Pruning-related variables and constants */ 50 | /** True if we're running in -prune mode. */ 51 | extern bool fPruneMode; 52 | -/** Number of MiB of block files that we're trying to stay below. */ 53 | +/** Number of bytes of block files that we're trying to stay below. */ 54 | extern uint64_t nPruneTarget;
I've checked and indeed, this value is in bytes. The -prune option is in MiB, but it's multiplied with 1024*1024 before being stored here.
53 | @@ -54,7 +54,7 @@ static constexpr uint8_t PSBT_SEPARATOR = 0x00; 54 | 55 | // BIP 174 does not specify a maximum file size, but we set a limit anyway 56 | // to prevent reading a stream indefinitely and running out of memory. 57 | -const std::streamsize MAX_FILE_SIZE_PSBT = 100000000; // 100 MiB 58 | +const std::streamsize MAX_FILE_SIZE_PSBT = 100000000; // 100 MB
These kind of comments are really asking to go out of sync, would be fine with removing it as well.
Would using C++14 digit separators be an idea maybe? 100'000'000?
ACK 241c4d047ee658a976625c39c6acd04dd7b071ef, with or without #25299 (review)
Code review ACK 241c4d047ee658a976625c39c6acd04dd7b071ef