private void MergeTransaction(NeoAPI api, Transaction tx) { transactions[tx.Hash] = tx; foreach (var input in tx.inputs) { if (!transactions.ContainsKey(input.prevHash)) { var other = api.GetTransaction(input.prevHash); transactions[other.Hash] = other; external_txs.Add(other.Hash); } } }
/// <summary> /// Fetches a transaction from local catch. If not found, will try fetching it from a NEO blockchain node /// </summary> /// <param name="hash">Hash of the transaction</param> /// <returns></returns> public Transaction GetTransaction(UInt256 hash) { return(transactions.ContainsKey(hash) ? transactions[hash] : neo_api.GetTransaction(hash)); }