This is to track the regression introduced in master, which needs fixing for 0.14. See #9240, #9371, etc.
{
    
    
    
    int nMinOrderPos = std::numeric_limits<int>::max();
    const CWalletTx* copyFrom = NULL;
    for (TxSpends::iterator it = range.first; it != range.second; ++it)
    {
        const uint256& hash = it->second;