aboutsummaryrefslogtreecommitdiff
path: root/src/httpserver.cpp
diff options
context:
space:
mode:
authorKarl-Johan Alm <[email protected]>2020-01-24 13:02:13 +0900
committerKarl-Johan Alm <[email protected]>2020-03-24 11:57:19 +0900
commitac94141af0c16161afa68de1c3720f254ae4e12c (patch)
treed88333902e14e5f574b1fe146529b1da02e1d33c /src/httpserver.cpp
parentMerge #17887: bug-fix macos: give free bytes to F_PREALLOCATE (diff)
downloaddiscoin-ac94141af0c16161afa68de1c3720f254ae4e12c.tar.xz
discoin-ac94141af0c16161afa68de1c3720f254ae4e12c.zip
validation: delay flushing undo files in syncing node case
Data files are pre-allocated, and upon flush/finalization, they are trimmed down to their resulting size. Block (blk) files are written to disk as blocks come in, which is often out of order, whereas undo (rev) files are written sequentially, as each block is added to the top of the chain. When a block file hits the size limit, the system flushes and trims the file down to its final size, and moves on to the next block file. Case 1: blocks are added to the chain as they come in (synced up node case) -- in this case, we will flush and finalize the undo file together with the block file. Case 2: blocks are added to the chain after they have been downloaded (syncing node case) -- in this case, we postpone finalizing the undo file until we know the undo data for the last block in the file has been written to disk.
Diffstat (limited to 'src/httpserver.cpp')
0 files changed, 0 insertions, 0 deletions