> Previously, wait_for_getdata only looked for the presence of a recent "getdata" message. Additionally checking the object hashes inside the message should make tests involving wait_for_getdata more robust.
>
> p2p_sendheaders.py already overrides wait_for_getdata do this check; we can use the same approach consistently across all tests that call wait_for_getdata.
This is a backport of Core PR18690