Background is that I saw an integer overflow in net_processing #30629113 REDUCE cov: 25793 ft: 142917 corp: 3421/2417Kb lim: 4096exec/s: 89 rss: 614Mb L: 1719/4096 MS: 1 EraseBytes... net_processing.cpp:977:25: runtime error: signed integer overflow: 2147483624 + 100 cannot be represented in type 'int' UndefinedBehaviorSanitizer: undefined-behavior net_processing.cpp:977:25 in net_processing.cpp:985:9: runtime error: signed integer overflow: -2147483572 - 100 cannot be represented in type 'int' SUMMMARY: UndefinedBehaviorSanitizer: undefined-behavior net_processing.cpp:985:9 in
Telling from the line numbers, it looks like nMisbehavior wrapped
around.
Fix that by calling StopNodes after each exec, which should clear the
node state and thus nMisbehavior.
Backport of core PR18875