In the log I see things like:

    2017-09-13 03:54:33 init message: Rescanning...
    2017-09-13 03:54:33 Rescanning last 68616 blocks (from block 416339)...
    2017-09-13 03:54:40 AddToWallet xxxxx  update
    2017-09-13 03:55:33 Still rescanning. At block 418849. Progress=0.549138

I would be interested to see the wallet file name on each of these log lines.

Would there be any interest in merging such a PR?
std::vector<uint256> vMatch;
    std::vector<unsigned int> vIndex;
    unsigned int txnIndex = 0;
    if (merkleBlock.txn.ExtractMatches(vMatch, vIndex) == merkleBlock.header.hashMerkleRoot) {
        LOCK(cs_main);
        const CBlockIndex* pindex = LookupBlockIndex(merkleBlock.header.GetHash());
        if (!pindex || !chainActive.Contains(pindex)) {
            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found in chain");
        }
        std::vector<uint256>::const_iterator it;
        if ((it = std::find(vMatch.begin(), vMatch.end(), hashTx))==vMatch.end()) {
            throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Transaction given doesn't exist in proof");
        }
        txnIndex = vIndex[it - vMatch.begin()];
    }
    else {
        throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Something wrong with merkleblock");
    }
    wtx.nIndex = txnIndex;
    wtx.hashBlock = merkleBlock.header.GetHash();
    LOCK2(cs_main, pwallet->cs_wallet);
    if (pwallet->IsMine(*wtx.tx)) {
        pwallet->AddToWallet(wtx, false);
        return NullUniValue;
    }
    throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No addresses in wallet correspond to included transaction");
}
UniValue removeprunedfunds(const JSONRPCRequest& request)
{
    std::shared_ptr<CWallet> const wallet = GetWalletForJSONRPCRequest(request);