move buildRemoteSighash out of the avalanche codebase
Summary:
This function is only used once, and only in the network layer.
Move the code where it is needed, to make it easier to maintain.
This will make it easier to protect CNode::m_avalanche_state with a lock if we
decide to do so (see review of D9686)
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D9708