From 928d937a7b68ac134e67c02c7d2fcfb22e35d7aa Mon Sep 17 00:00:00 2001 From: sowle Date: Wed, 23 Nov 2022 19:28:17 +0100 Subject: [PATCH] get_amount_from_variant() made noexcept --- src/currency_core/currency_format_utils.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/currency_core/currency_format_utils.h b/src/currency_core/currency_format_utils.h index a5419b20..db3f690a 100644 --- a/src/currency_core/currency_format_utils.h +++ b/src/currency_core/currency_format_utils.h @@ -815,9 +815,16 @@ namespace currency uint64_t operator()(const txin_zc_input&) const { return 0; } uint64_t operator()(const txin_gen& i) const { return 0; } }; - inline uint64_t get_amount_from_variant(const txin_v& v) + inline uint64_t get_amount_from_variant(const txin_v& v) noexcept { - return boost::apply_visitor(input_amount_getter(), v); + try + { + return boost::apply_visitor(input_amount_getter(), v); + } + catch(...) + { + return 0; + } } //--------------------------------------------------------------- struct output_amount_getter : public boost::static_visitor