HomePhabricator

univalue: Throw exception on invalid pushes over silent ignore

Description

univalue: Throw exception on invalid pushes over silent ignore

Summary:

The return value of the push* helpers is never used, but important to determine if the operation was successful. One way to fix this would be to add the "nodiscard" attribute. However, this would make the code (and this diff) overly verbose for no reason.

So fix it by removing the never used return value. Also, fail verbosely in case of a programming mistake.

Backport of core#25551.

Depends on D16276.

Test Plan:

ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D16280

Details

Provenance
MacroFake <falke.marco@gmail.com>Authored on Jul 6 2022, 09:46
FabienCommitted on Jun 5 2024, 17:49
FabienPushed on Jun 5 2024, 17:49
Reviewer
Restricted Project
Differential Revision
D16280: univalue: Throw exception on invalid pushes over silent ignore
Parents
rABC44e5081165ef: rpc: Reduce Univalue push_backV peak memory usage in listtransactions
Branches
Unknown
Tags
Unknown