From d6440ab319ea6adf21485550d6a08ae452d49818 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 28 Apr 2018 12:11:42 +0100 Subject: wallet2: recover from index out of hashchain bounds error This can happen when there's a very large reorg on the daemon (ie, on testnet) --- src/wallet/wallet_errors.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/wallet/wallet_errors.h') diff --git a/src/wallet/wallet_errors.h b/src/wallet/wallet_errors.h index 214d51cde..e80652750 100644 --- a/src/wallet/wallet_errors.h +++ b/src/wallet/wallet_errors.h @@ -70,6 +70,7 @@ namespace tools // get_out_indexes_error // tx_parse_error // get_tx_pool_error + // out_of_hashchain_bounds_error // transfer_error * // get_random_outs_general_error // not_enough_unlocked_money @@ -398,6 +399,16 @@ namespace tools std::string to_string() const { return refresh_error::to_string(); } }; //---------------------------------------------------------------------------------------------------- + struct out_of_hashchain_bounds_error : public refresh_error + { + explicit out_of_hashchain_bounds_error(std::string&& loc) + : refresh_error(std::move(loc), "Index out of bounds of of hashchain") + { + } + + std::string to_string() const { return refresh_error::to_string(); } + }; + //---------------------------------------------------------------------------------------------------- struct transfer_error : public wallet_logic_error { protected: -- cgit v1.2.3