Currently, we use `assert` in RPC code to document logic and code assumptions. However, it seems a bit extreme to abort all of Bitcoin Core on an assert failure in one of the RPC threads. I suggest to replace all checks with a macro `THROW_LOGIC_ERROR_IF_ASSERT_FAILS(condition)` that does what it says. That logic error will then be returned to the rpc caller and will include instructions to report the error to our issue tracker.

Any objections or naming suggestions for that macro?
},
                        "[scanobjects,...]"},
                },
                RPCResult{
            "{\n"
            "  \"success\": true|false,         (boolean) Whether the scan was completed\n"
            "  \"txouts\": n,                   (numeric) The number of unspent transaction outputs scanned\n"
            "  \"height\": n,                   (numeric) The current block height (index)\n"
            "  \"bestblock\": \"hex\",            (string) The hash of the block at the tip of the chain\n"
            "  \"unspents\": [\n"
            "   {\n"
            "    \"txid\": \"hash\",              (string) The transaction id\n"
            "    \"vout\": n,                   (numeric) The vout value\n"
            "    \"scriptPubKey\": \"script\",    (string) The script key\n"
            "    \"desc\": \"descriptor\",        (string) A specialized descriptor for the matched scriptPubKey\n"
            "    \"amount\": x.xxx,             (numeric) The total amount in " + CURRENCY_UNIT + " of the unspent output\n"
            "    \"height\": n,                 (numeric) Height of the unspent transaction output\n"
            "   }\n"
            "   ,...],\n"
            "  \"total_amount\": x.xxx,          (numeric) The total amount of all found unspent outputs in " + CURRENCY_UNIT + "\n"
            "]\n"
                },
                RPCExamples{""},
            }.Check(request);
    RPCTypeCheck(request.params, {UniValue::VSTR, UniValue::VARR});
    UniValue result(UniValue::VOBJ);
    if (request.params[0].get_str() == "status") {
        CoinsViewScanReserver reserver;
        if (reserver.reserve()) {