There are some potential feefilter cleanups mentioned and motivated in comment https://github.com/bitcoin/bitcoin/pull/21509#issuecomment-805808485 . If you address the locking one, please be careful and make sure that `round()` is only called under a lock. See https://github.com/bitcoin/bitcoin/pull/21509#issuecomment-807992199

#### Useful skills:

* Bitcoin protocol messages
* Bitcoin Core P2P design
* Running our unit and functional tests

#### Want to work on this issue?

For guidance on contributing, please read [CONTRIBUTING.md](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md) before opening your pull request.

{
    {
        LOCK(peer.m_misbehavior_mutex);
        
        if (!peer.m_should_discourage) return false;
        peer.m_should_discourage = false;
    } 
    if (pnode.HasPermission(NetPermissionFlags::NoBan)) {
        
        LogPrintf("Warning: not punishing noban peer %d!\n", peer.m_id);
        return false;
    }
    if (pnode.IsManualConn()) {
        
        LogPrintf("Warning: not punishing manually connected peer %d!\n", peer.m_id);
        return false;
    }
    if (pnode.addr.IsLocal()) {
        
        
        LogPrint(BCLog::NET, "Warning: disconnecting but not discouraging %s peer %d!\n",
                 pnode.m_inbound_onion ? "inbound onion" : "local", peer.m_id);
        pnode.fDisconnect = true;
        return true;
    }
    
    LogPrint(BCLog::NET, "Disconnecting and discouraging peer %d!\n", peer.m_id);
    if (m_banman) m_banman->Discourage(pnode.addr);
    m_connman.DisconnectNode(pnode.addr);
    return true;