`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.
#include <stdexcept>
#include <stdint.h>
#include <string>
#include <utility>
#include <vector>
bool VerifyWallets(interfaces::Chain& chain, const std::vector<std::string>& wallet_files);
bool LoadWallets(interfaces::Chain& chain, const std::vector<std::string>& wallet_files);
void StartWallets(CScheduler& scheduler);
void FlushWallets();
void StopWallets();
void UnloadWallets();
bool AddWallet(const std::shared_ptr<CWallet>& wallet);
bool RemoveWallet(const std::shared_ptr<CWallet>& wallet);
bool HasWallets();
std::vector<std::shared_ptr<CWallet>> GetWallets();
std::shared_ptr<CWallet> GetWallet(const std::string& name);
static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000;
constexpr CAmount DEFAULT_PAY_TX_FEE = 0;
static const CAmount DEFAULT_FALLBACK_FEE = 20000;
static const CAmount DEFAULT_DISCARD_FEE = 10000;
static const CAmount DEFAULT_TRANSACTION_MINFEE = 1000;
static const CAmount WALLET_INCREMENTAL_RELAY_FEE = 5000;
static const bool DEFAULT_SPEND_ZEROCONF_CHANGE = true;
static const bool DEFAULT_WALLET_REJECT_LONG_CHAINS = false;
static const bool DEFAULT_AVOIDPARTIALSPENDS = false;
static const unsigned int DEFAULT_TX_CONFIRM_TARGET = 6;
static const bool DEFAULT_WALLET_RBF = false;
static const bool DEFAULT_WALLETBROADCAST = true;
static const bool DEFAULT_DISABLE_WALLET = false;
class CBlockIndex;