diff options
Diffstat (limited to 'src/node/utxo_snapshot.cpp')
-rw-r--r-- | src/node/utxo_snapshot.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/node/utxo_snapshot.cpp b/src/node/utxo_snapshot.cpp index 976421e455..7d589c886b 100644 --- a/src/node/utxo_snapshot.cpp +++ b/src/node/utxo_snapshot.cpp @@ -73,9 +73,11 @@ std::optional<uint256> ReadSnapshotBaseBlockhash(fs::path chaindir) } afile >> base_blockhash; - if (std::fgetc(afile.Get()) != EOF) { + int64_t position = afile.tell(); + afile.seek(0, SEEK_END); + if (position != afile.tell()) { LogPrintf("[snapshot] warning: unexpected trailing data in %s\n", read_from_str); - } else if (std::ferror(afile.Get())) { + } else if (afile.IsError()) { LogPrintf("[snapshot] warning: i/o error reading %s\n", read_from_str); } return base_blockhash; |