Review report

bitcoin/bitcoin: PR #36736

1 suggestion

Optional improvements

Link

[suggestion] · Paused-send timeout decisions lack focused test coverage

The new accessor test would still pass if the rewritten inactivity check stopped timing out paused peers or used the wrong deadline.

Location: src/net.cpp:2087 (head).

Details and suggested fix

cnode_pause_send verifies timestamp transitions but never calls InactivityCheck, leaving the sustained-pause timeout, strict > boundary, and deadline reset without assertions. Existing functional tests may catch erroneous disconnects of unpaused peers, but do not check these paused-send decisions. Add a public InactivityCheck wrapper to the existing friend ConnmanTestMsg and test it with FakeNodeClock. Set a small peer-connect timeout and advance past the connection-age gate, mark the peer successfully connected, and refresh m_last_send and m_last_recv before each check so unrelated timeout paths do not determine the result. Pause under cs_vSend, then assert false at pause start plus TIMEOUT_INTERVAL and true one second later. Resume and pause again at a later time, and verify that the old deadline no longer triggers while the new one does. This coverage gap predates the PR, but the PR rewrites the decision it leaves untested.


Coverage details