//If the "sum of all your UTXO smaller than the Target" happens to match the Target, they will be used. (This is the case if you sweep a complete wallet.)
//If the "sum of all your UTXO smaller than the Target" doesn't surpass the target, the smallest UTXO greater than your Target will be used.
returnnew[]{coin};
returncoinGroup.Coins;
}
else
{
//Else Bitcoin Core does 1000 rounds of randomly combining unspent transaction outputs until their sum is greater than or equal to the Target. If it happens to find an exact match, it stops early and uses that.
//Else Bitcoin Core does 1000 rounds of randomly combining unspent transaction outputs until their sum is greater than or equal to the Target. If it happens to find an exact match, it stops early and uses that.
//Otherwise it finally settles for the minimum of
//the smallest UTXO greater than the Target
//the smallest combination of UTXO it discovered in Step 4.
vardummy=Transaction.AddInput(newTxIn(newOutPoint(newuint256(1),0)));//Since a transaction without input will be considered without marker, insert a dummy
TxIndummy=this.Transaction.AddInput(newTxIn(newOutPoint(newuint256(1),0)));//Since a transaction without input will be considered without marker, insert a dummy