This is a more narrowly-construed wait which eliminates the possibility of the
wait being triggered by other messages.
Co-authored-by: Billy Garrison <billygarrison.btc@gmail.com>
This is a backport of [[https://github.com/bitcoin/bitcoin/pull/19631 | core#19631]]