Files
bitcoin/src
furszy 5dfbb91b6c dbwrapper: add TryRead() to distinguish errors from valid outcomes
Read() returns false for both a missing key and a deserialization
failure, making it impossible for callers to distinguish between
them.

This commits adds TryRead() returning a ReadStatus struct that
discriminates between:

- true:                  record found, value deserialized
- false:                 record not found
- DatabaseError:         levelDB threw during record read
- DeserializationError:  key present, value incompatible with
                         expected format

An err_msg field preserves the original exception message for
diagnostic purposes.

This also makes Read() a thin wrapper over TryRead() to keep
existing call sites unchanged.

Note:
Key serialization is the only operation that may throw in
TryRead(), as callers are expected to provide well-formed keys.
This is why this function is not noexcept.
2026-08-29 10:59:12 -04:00
..
2026-03-19 19:13:40 +00:00
2026-02-16 16:09:30 -03:00
2026-02-17 21:40:46 +05:30
2026-02-25 14:36:19 -08:00
2026-03-04 15:06:34 +01:00