Try to generate a stacktrace for runtime errors in consolidation

This commit is contained in:
Jonathan "Duke" Leto
2022-09-09 06:30:06 -07:00
parent 8770fb7035
commit 4647bc8525

View File

@@ -16,6 +16,7 @@
#include "util.h"
#include "utilmoneystr.h"
#include "wallet.h"
#include <boost/stacktrace.hpp>
CAmount fConsolidationTxFee = DEFAULT_CONSOLIDATION_FEE;
bool fConsolidationMapUsed = false;
@@ -44,6 +45,11 @@ void AsyncRPCOperation_saplingconsolidation::main() {
set_error_code(code);
set_error_message(message);
} catch (const runtime_error& e) {
const boost::stacktrace::stacktrace* st = boost::get_error_info<traced>(e);
if (st) {
std::cerr << *st << '\n';
}
set_error_code(-1);
set_error_code(-1);
set_error_message("runtime error: " + string(e.what()));
} catch (const logic_error& e) {