Steps to reproduce:

1. put `changetype=bech32` in bitcoin.conf or launch QT with `-changetype=bech32`
2. send money to any legacy address
3. use `decoderawtransaction` to see that the change address is `bech32`, as expected since #12119

4. enable Coin Control in settings menu
5. send money to any legacy address
6. use `decoderawtransaction` to see that the change address is now `p2sh-segwit`
if (index+1 > static_cast<int>(confTargets.size())) {
        return confTargets.back();
    }
    if (index < 0) {
        return confTargets[0];
    }
    return confTargets[index];
}
int getIndexForConfTarget(int target) {