tx-submission: fixed a race condition
There was a race condition between the `decisionLogicThread` producing
a `TxDecision` and an inbound server picking up the most up to date
`TxDecision`. This would lead to the inbound side issuing a blocking request
when the client was awaiting for a non-blocking request. This blocking
request isn't wrong considering the issued decision; it is a legit
decision that's made which leads to the inbound server issuing a
blocking request but because we have received a txid in the meantime and
didn't manage to read it soon enough we didn't create a more important
decision. The fix involved being aware of how many requests for txs we
have in flight and not generate "low priority" policies.
`hasTxIdsToAcknowledge` is not used anywhere in the code so it is
removed.
`filterActivePeers` is improved by making its decision logic more closed
to `pickTxsToDownload`.
`filterActivePeers` test is fixed, since it doesn't hold under the new
logic:
`filterActivePeers` will not compute a decision for peers which have
`requestedTxIdsInflight` and `makeDecisions` computes non-empty decisions
for peers with no `requestedTxIdsInflight`. So:
1. "The set of active peers is a superset of peers for which a decision
was made" this is not true since it is possible that a non active
peer has a legitimate decision, but due to our race-condition
protection condition we just don't generate it.
2. "The set of active peer which can acknowledge txids is a subset of
peers for which a decision was made" this is removed since
hasTxIdsToAcknowledge function is removed
3. "Decisions made from the results of `filterActivePeers` is the same
as from the original set" this isn't true because of what I said
above
So I refactored the test to check that the number of filtered decisions
is a subset of the total number of decisions, which I believe to be a
more accurate test for the current logic