diff options
author | fanquake <fanquake@gmail.com> | 2020-04-26 20:01:46 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2020-04-29 11:20:22 +0800 |
commit | 06442549f8b725f46c1c727e9eb6fde6b843503c (patch) | |
tree | 13cccca00de2f9c22549cb878df0b5923fbfb8af /src/validation.h | |
parent | ba348dbc518b8e082a5dc3a225432fdacf859a13 (diff) | |
download | bitcoin-06442549f8b725f46c1c727e9eb6fde6b843503c.tar.xz |
validation: Add minimum witness commitment size constant
Per BIP 141, the witness commitment structure is atleast 38 bytes,
OP_RETURN (0x6a) + 36 (0x24) + 4 byte header (0xaa21a9ed) + 32 byte
SHA256 hash. It can be longer, however any additional data has no
consensus meaning.
Diffstat (limited to 'src/validation.h')
-rw-r--r-- | src/validation.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/validation.h b/src/validation.h index 91b1ba6497..0169362768 100644 --- a/src/validation.h +++ b/src/validation.h @@ -92,6 +92,8 @@ static const unsigned int DEFAULT_CHECKLEVEL = 3; // one 128MB block file + added 15% undo data = 147MB greater for a total of 545MB // Setting the target to >= 550 MiB will make it likely we can respect the target. static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024; +/** Minimum size of a witness commitment structure. Defined in BIP 141. **/ +static constexpr size_t MINIMUM_WITNESS_COMMITMENT{38}; struct BlockHasher { |