Esempio n. 1
0
        void ProcessBlock(Block block, int height, uint256 hashBlock)
        {
            var walletBlock = BlockService.AnalyzeBlock(block, height, this.metadata.Blocks.Values, GetOrAddAddress);

            if (walletBlock != null)
            {
                if (!this.metadata.Blocks.TryAdd(height, walletBlock))
                {
                    MoveToBestChain();
                    SyncWallet();
                }


                MigrateMemoryPoolTransactions(walletBlock.Transactions);

                Log.BlockAddedToWallet(height, walletBlock);
            }

            UpdateLastBlockSyncedAndCheckpoint(height, hashBlock);

            if (!this.isStartingUp)
            {
                SaveMetadata();
            }
        }