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;
}
}