diff options
author | James O'Beirne <james.obeirne@pm.me> | 2022-04-20 14:59:02 -0400 |
---|---|---|
committer | James O'Beirne <james.obeirne@pm.me> | 2022-09-13 13:30:12 -0400 |
commit | f9f1735f139b6a1f1c7fea50717ff90dc4ba2bce (patch) | |
tree | e6ac4570d221ba23b3778ffd42a84e04eea24a80 /src/streams.h | |
parent | d14bebf100aaaa25c7558eeed8b5c536da99885f (diff) |
validation: rename snapshot chainstate dir
This changes the snapshot's leveldb chainstate dir name from
`chainstate_[blockhash]` to `chainstate_snapshot`. This simplifies
later logic that loads snapshot data, and enforces the limitation
of a single snapshot at any given time.
Since we still need to persis the blockhash of the base block, we
write that out to a file (`chainstate_snapshot/base_blockhash`) for
later use during initialization, so that we can reinitialize the
snapshot chainstate.
Co-authored-by: Russell Yanofsky <russ@yanofsky.org>
Diffstat (limited to 'src/streams.h')
-rw-r--r-- | src/streams.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/streams.h b/src/streams.h index f14d347380..1bd98f8164 100644 --- a/src/streams.h +++ b/src/streams.h @@ -488,12 +488,14 @@ public: AutoFile(const AutoFile&) = delete; AutoFile& operator=(const AutoFile&) = delete; - void fclose() + int fclose() { + int retval{0}; if (file) { - ::fclose(file); + retval = ::fclose(file); file = nullptr; } + return retval; } /** Get wrapped FILE* with transfer of ownership. |