While reviewing #28331 we noticed a crash that wasn’t caught by the test suite, but would very quickly happen on a real node. See #28331 (review)
I was able to reproduce it by calling addnode
twice and having the test suite wait a little bit. But this also involved hacking ThreadOpenAddedConnections
to wait 1 second instead of a full minute. See https://github.com/Sjors/bitcoin/commit/bc3995c66300fb3139c5360e8f6ee807b02ea86e
If the test suite could mock the delay in ThreadOpenAddedConnections
we can add a regular test for this.
It would also be a good idea to test MAX_ADDNODE_CONNECTIONS
, which should be a simple matter of spinning up ~10 test nodes.