diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-05-02 14:10:27 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-05-15 08:11:56 +0200 |
commit | 0bf431870e45d8e20c4671e51a782ebf97b75fac (patch) | |
tree | 44e2e163ef3cffeb6af12a93293a964328b7a9dc /src/validation.h | |
parent | 598db389c33e5e90783ef1223df2eeab095ed622 (diff) |
net: Serve blocks directly from disk when possible
In `ProcessGetBlockData`, send the block data directly from disk if
type MSG_WITNESS_BLOCK is requested. This is a valid shortcut as the
on-disk format matches the network format.
This is expected to increase performance because a deserialization and
subsequent serialization roundtrip is avoided.
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 9b40100765..b5ab10786a 100644 --- a/src/validation.h +++ b/src/validation.h @@ -398,6 +398,8 @@ void InitScriptExecutionCache(); /** Functions for disk access for blocks */ bool ReadBlockFromDisk(CBlock& block, const CDiskBlockPos& pos, const Consensus::Params& consensusParams); bool ReadBlockFromDisk(CBlock& block, const CBlockIndex* pindex, const Consensus::Params& consensusParams); +bool ReadRawBlockFromDisk(std::vector<uint8_t>& block, const CDiskBlockPos& pos, const CMessageHeader::MessageStartChars& message_start); +bool ReadRawBlockFromDisk(std::vector<uint8_t>& block, const CBlockIndex* pindex, const CMessageHeader::MessageStartChars& message_start); /** Functions for validating blocks and updating the block tree */ |