private void Received(TrackedScript match, IndexedTxOut txout, ChainedBlock block, MerkleBlock proof) { var operation = new Operation(txout.Transaction, block, proof); SetUnconfirmedSeenIfPossible(txout.Transaction, block, operation); var coin = new Coin(txout); operation.ReceivedCoins.Add(Tuple.Create(coin, match.GetId())); _Operations.AddOrUpdate(operation.GetId(), operation, (k, old) => old.Merge(operation)); var trackedOutpoint = new TrackedOutpoint() { Coin = coin, TrackedScriptId = match.GetId(), Filter = match.Filter }; _TrackedOutpoints.TryAdd(trackedOutpoint.GetId(), trackedOutpoint); }
private Operation Received(TrackedScript match, IndexedTxOut txout, ChainedBlock block, MerkleBlock proof) { var operation = new Operation(txout.Transaction, block, proof, _TrackedScripts); SetUnconfirmedSeenIfPossible(txout.Transaction, block, operation); var coin = new Coin(txout); operation.ReceivedCoins.Add(Tuple.Create(coin, match.GetId())); bool merged = false; var returned = _Operations.AddOrUpdate(operation.GetId(), operation, (k, old) => old.Merge(operation, out merged)); var trackedOutpoint = new TrackedOutpoint() { Coin = coin, TrackedScriptId = match.GetId(), Filter = match.Filter }; _TrackedOutpoints.TryAdd(trackedOutpoint.GetId(), trackedOutpoint); return((operation == returned || merged) ? operation : null); }
public Task <TrustedInput> GetTrustedInputAsync(IndexedTxOut txout, CancellationToken cancellation = default(CancellationToken)) { return(GetTrustedInputAsync(txout.Transaction, (int)txout.N, cancellation)); }
public TrustedInput GetTrustedInput(IndexedTxOut txout, CancellationToken cancellation = default(CancellationToken)) { return(GetTrustedInputAsync(txout.Transaction, (int)txout.N, cancellation).GetAwaiter().GetResult()); }
public TrustedInput GetTrustedInput(IndexedTxOut txout) { return GetTrustedInput(txout.Transaction, (int)txout.N); }
public ScriptCoin(IndexedTxOut txOut, Script redeem) : base(txOut) { Redeem = redeem; AssertCoherent(); }
public Coin(IndexedTxOut txOut) { Outpoint = new OutPoint(txOut.Transaction.GetHash(), txOut.N); TxOut = txOut.TxOut; }
public TrustedInput GetTrustedInput(IndexedTxOut txout) { return(GetTrustedInputAsync(txout.Transaction, (int)txout.N).GetAwaiter().GetResult()); }
public Task <TrustedInput> GetTrustedInputAsync(IndexedTxOut txout) { return(GetTrustedInputAsync(txout.Transaction, (int)txout.N)); }
private Operation Received(TrackedScript match, IndexedTxOut txout, ChainedBlock block, MerkleBlock proof) { var operation = new Operation(txout.Transaction, block, proof, _TrackedScripts); SetUnconfirmedSeenIfPossible(txout.Transaction, block, operation); var coin = new Coin(txout); operation.ReceivedCoins.Add(Tuple.Create(coin, match.GetId())); bool merged = false; var returned = _Operations.AddOrUpdate(operation.GetId(), operation, (k, old) => old.Merge(operation, out merged)); var trackedOutpoint = new TrackedOutpoint() { Coin = coin, TrackedScriptId = match.GetId(), Filter = match.Filter }; _TrackedOutpoints.TryAdd(trackedOutpoint.GetId(), trackedOutpoint); return (operation == returned || merged) ? operation : null; }
public WitScriptCoin(IndexedTxOut txOut, Script witRedeem) : base(txOut) { SetAll(txOut.TxOut.ScriptPubKey, witRedeem); }