Last active
October 19, 2019 21:41
-
-
Save farukterzioglu/0e2278de53cd9ad8ca5acef67b3b06ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var inputList = new List<UnspentCoin>(); | |
var unspentResponse = await client.ListUnspentAsync(); | |
var unspentList = unspentResponse.OrderByDescending( x => x.Amount).ToList(); | |
var inputBtcSum = new Money(0, MoneyUnit.BTC); | |
foreach (var unspent in unspentList) { | |
if( inputBtcSum >= totalPaymentAmountBtc) break; | |
inputBtcSum += unspent.Amount; | |
inputList.Add(unspent); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment