private static short?GetFeeTransactionIndex(SortedList <TransactionHash, SignedTransaction> transactions, SignedTransaction fees) { if (fees == null) { return(null); } return((short)transactions.IndexOfKey(fees.Hash)); }
public static Block CreateBlock(long ledgerHeight, List <SignedTransaction> transactions, SignedTransaction feeTransaction = null) { var sorted = SortTransactions(transactions); if (feeTransaction != null) { sorted.Add(feeTransaction.Hash, feeTransaction); } return(new Block(ledgerHeight, sorted, GetFeeTransactionIndex(sorted, feeTransaction))); }