def UtxoFilter(utxos, amount):
    selected = []
    from decimal import Decimal
    nSum = Decimal('0')
    nFee = Decimal('0.0')
    for utxo in [item for item in utxos if ((int(item['confirmations']) >= 1) and (float(item['amount']) > 0.0003))]:
        selected.append(utxo)
        nSum += Decimal(str(utxo['amount']))
        if (nSum > Decimal(str(amount))):
            nFee = BTC_EstimateSmartFee.calcFee(rpcconn, len(selected), 2)
            if (nSum > (nFee + amount)):
                break
    return (selected, nSum, nFee)
def UtxoFilter(utxos, amount):
    selected = []
    from decimal import Decimal
    nSum = Decimal('0')
    nFee = Decimal('0.0')
    for utxo in [item for item in utxos if ((int(item['confirmations']) >= 1) and (float(item['amount']) > 0.0003))]:
        selected.append(utxo)
        nSum += Decimal(str(utxo['amount']))
        if (nSum > Decimal(str(amount))):
            nFee = BTC_EstimateSmartFee.calcFee(rpcconn, len(selected), 2)
            if (nSum > (nFee + amount)):
                break
    return (selected, nSum, nFee)