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

Receive() private méthode

Called by the BlockChain when we receive a new block that sends coins to one of our addresses or spends coins from one of our addresses (note that a single transaction can do both).
This is necessary for the internal book-keeping Wallet does. When a transaction is received that sends us coins it is added to a pool so we can use it later to create spends. When a transaction is received that consumes outputs they are marked as spent so they won't be used in future.

A transaction that spends our own coins can be received either because a spend we created was accepted by the network and thus made it into a block, or because our keys are being shared between multiple instances and some other node spent the coins instead. We still have to know about that to avoid accidentally trying to double spend.

A transaction may be received multiple times if is included into blocks in parallel chains. The blockType parameter describes whether the containing block is on the main/best chain or whether it's on a presently inactive side chain. We must still record these transactions and the blocks they appear in because a future block might change which chain is best causing a reorganize. A re-org can totally change our balance!

private Receive ( Transaction tx, StoredBlock block, BlockChain blockType ) : void
tx Transaction
block StoredBlock
blockType BlockChain
Résultat void
        internal void Receive(Transaction tx, StoredBlock block, BlockChain.NewBlockType blockType)
        {
            lock (this)
            {
                Receive(tx, block, blockType, false);
            }
        }

Same methods

Wallet::Receive ( Transaction tx, StoredBlock block, BlockChain blockType, bool reorg ) : void