BitSharper.Wallet.ProcessTxFromBestChain C# (CSharp) Méthode

ProcessTxFromBestChain() private méthode

Handle when a transaction becomes newly active on the best chain, either due to receiving a new block or a re-org making inactive transactions active.
private ProcessTxFromBestChain ( Transaction tx ) : void
tx Transaction
Résultat void
        private void ProcessTxFromBestChain(Transaction tx)
        {
            // This TX may spend our existing outputs even though it was not pending. This can happen in unit
            // tests and if keys are moved between wallets.
            UpdateForSpends(tx);
            if (!tx.GetValueSentToMe(this).Equals(0))
            {
                // It's sending us coins.
                _log.Info("  new tx ->unspent");
                Debug.Assert(!Unspent.ContainsKey(tx.Hash), "TX was received twice");
                Unspent[tx.Hash] = tx;
            }
            else
            {
                // It spent some of our coins and did not send us any.
                _log.Info("  new tx ->spent");
                Debug.Assert(!Spent.ContainsKey(tx.Hash), "TX was received twice");
                Spent[tx.Hash] = tx;
            }
        }