Only return confirmed (not from mempool) outpoints in pvNoSpendsRemaining
,
as is the intended behaviour.
With the previous code, removed chains of tx would have all internally-spent outpoints included in this vector, which is not the intended result. It seems to have been incorrectly coded from the very start (https://github.com/bitcoin/bitcoin/pull/6872) but the bug is benign as this result is only used to uncache coins.
As a bonus, no copying of CTransaction is needed now.
An existing test case is modified to test this behaviour (the modified test fails under prior behaviour).
(this is an upstreaming of https://gitlab.com/bitcoin-cash-node/bitcoin-cash-node/-/merge_requests/761 )