[net] Add RunInactivityChecks()
Summary:
Moves the logic to prevent running inactivity checks until the peer has been connected for -peertimeout time into its own function. This will be reused by net_processing later.
Partial backport of core#20721:
https://github.com/bitcoin/bitcoin/pull/20721/commits/1a07600b4b0d08cffc7cd5c58af33fcd1ede558e
Depends on D10873.
Ref T1696.
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, PiRK
Reviewed By: #bitcoin_abc, PiRK
Maniphest Tasks: T1696
Differential Revision: https://reviews.bitcoinabc.org/D10875