`banlist.dat` was introduced in https://github.com/bitcoin/bitcoin/pull/6310, storing nodes that were automatically banned (due to exceeding the misbehavior threshold) and manually banned (through the `setban` RPC).

Automatic bans were removed in https://github.com/bitcoin/bitcoin/pull/19219 and replaced with a discouragement filter. That filter is not saved to disk/persisted over shutdown/startup. The `banlist.dat` therefore now only contains addresses that have been banned through the `setban` rpc.

Since https://github.com/bitcoin/bitcoin/pull/15935, we have a specific file for configuration that is updated through the RPC and persisted over shutdown/startup, namely `settings.json`. We should therefore move the manual ban configuration from `banlist.dat` to `settings.json`. Doing so has a couple of benefits:

- `settings.json` is human readable and easily analyzable by any json parser.
- we wouldn't need to maintain custom [de]serialization code for the `banlist.dat` file.

`banlist.dat` is expected to be fairly small and infrequently updated, so disk space/performance are not huge concerns.
{
    
    fs::path datadir = gArgs.GetDataDirNet();
    if (!DirIsWritable(datadir)) {
        return InitError(strprintf(_("Cannot write to data directory '%s'; check permissions."), datadir.string()));
    }
    if (!LockDirectory(datadir, ".lock", probeOnly)) {
        return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), datadir.string(), PACKAGE_NAME));
    }
    return true;
}
bool AppInitSanityChecks()
{
    
    init::SetGlobals();
    if (!init::SanityChecks()) {
        return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), PACKAGE_NAME));
    }
    
    
    
    return LockDataDirectory(true);
}
bool AppInitLockDataDirectory()