mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Simplify serialize.h's exception handling
Remove the 'state' and 'exceptmask' from serialize.h's stream implementations, as well as related methods. As exceptmask always included 'failbit', and setstate was always called with bits = failbit, all it did was immediately raise an exception. Get rid of those variables, and replace the setstate with direct exception throwing (which also removes some dead code). As a result, good() is never reached after a failure (there are only 2 calls, one of which is in tests), and can just be replaced by !eof(). fail(), clear(n) and exceptions() are just never called. Delete them.
This commit is contained in:
@@ -3228,7 +3228,7 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
|
||||
}
|
||||
}
|
||||
uint64_t nRewind = blkdat.GetPos();
|
||||
while (blkdat.good() && !blkdat.eof()) {
|
||||
while (!blkdat.eof()) {
|
||||
boost::this_thread::interruption_point();
|
||||
|
||||
blkdat.SetPos(nRewind);
|
||||
|
||||
Reference in New Issue
Block a user