mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
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>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user