`ScanForWalletTransactions()` has the following comment about its return value:

```
 * Returns null if scan was successful. Otherwise, if a complete rescan was not
 * possible (due to pruning or corruption), returns pointer to the most recent
 * block that could not be scanned.
```

This is not strictly true. If `abortrescan` is called, then `ScanForWalletTransactions()` will return `nullptr`, even though the scan wasn't successful to the tip.

This in turn causes a minor bug in `importmulti`, where the call doesn't return the correct error and warning about potentially not finding transactions if `abortrescan` was called.

I think the correct fix is for `ScanForWalletTransactions()` to inform the caller that the rescan was aborted.
int target_confirms = 1;
    isminefilter filter = ISMINE_SPENDABLE;
    if (!request.params[0].isNull() && !request.params[0].get_str().empty()) {
        uint256 blockId(ParseHashV(request.params[0], "blockhash"));
        paltindex = pindex = LookupBlockIndex(blockId);
        if (!pindex) {
            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found");
        }
        if (chainActive[pindex->nHeight] != pindex) {
            
            
            
            pindex = chainActive.FindFork(pindex);
        }
    }
    if (!request.params[1].isNull()) {
        target_confirms = request.params[1].get_int();
        if (target_confirms < 1) {
            throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter");
        }
    }
    if (!request.params[2].isNull() && request.params[2].get_bool()) {
        filter = filter | ISMINE_WATCH_ONLY;
    }
    bool include_removed = (request.params[3].isNull() || request.params[3].get_bool());
    int depth = pindex ? (1 + chainActive.Height() - pindex->nHeight) : -1;
    UniValue transactions(UniValue::VARR);
    for (const std::pair<const uint256, CWalletTx>& pairWtx : pwallet->mapWallet) {
        CWalletTx tx = pairWtx.second;
        if (depth == -1 || tx.GetDepthInMainChain(*locked_chain) < depth) {