diff --git a/src/rpc/handlers/GatewayBalances.cpp b/src/rpc/handlers/GatewayBalances.cpp index 27d60c30..7cf874f5 100644 --- a/src/rpc/handlers/GatewayBalances.cpp +++ b/src/rpc/handlers/GatewayBalances.cpp @@ -151,7 +151,17 @@ doGatewayBalances(Context const& context) bal = -balance; } else - bal -= balance; + { // when overflow happens, insert a flag to indicate + // https://github.com/XRPLF/rippled/pull/4355 + try + { + bal -= balance; + } + catch (std::runtime_error& e) + { + response["overflow"] = true; + } + } } } return true;