HomePhabricator

Simplify serialize.h's exception handling
eb0b56b19017Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

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.

Details

Provenance
Pieter Wuille <pieter.wuille@gmail.com>Authored on Aug 1 2014, 20:57
deadalnixPushed on May 14 2017, 22:04
Parents
rABCde89257fc516: Merge branch 'merge-rawtx2' into merge-rawtx3
Branches
Unknown
Tags
Unknown

Event Timeline

Pieter Wuille <pieter.wuille@gmail.com> committed rABCeb0b56b19017: Simplify serialize.h's exception handling (authored by Pieter Wuille <pieter.wuille@gmail.com>).Aug 8 2014, 23:43