private async Task RemoveBlocksAsync(List <Hash> blockHashes) { foreach (var blockHash in blockHashes) { await _chainManager.RemoveChainBlockLinkAsync(blockHash); await _blockManager.RemoveBlockAsync(blockHash); } }
public async Task IterationCleanup() { await _blockStateSets.RemoveAsync(_block.GetHash().ToStorageKey()); await _transactionManager.RemoveTransactionsAsync(_block.Body.TransactionIds); await RemoveTransactionResultsAsync(_block.Body.TransactionIds, _block.GetHash()); await _chainManager.RemoveChainBlockLinkAsync(_block.GetHash()); await _blockManager.RemoveBlockAsync(_block.GetHash()); await _chains.SetAsync(_chain.Id.ToStorageKey(), _chain); }
public async Task IterationCleanup() { await _transactionPoolService.CleanByTransactionIdsAsync(_block.TransactionIds); await _transactionPoolService.UpdateTransactionPoolByBestChainAsync(_chain.BestChainHash, _chain.BestChainHeight); await _transactionManager.RemoveTransactionsAsync(_block.Body.TransactionIds); await _chainManager.RemoveChainBlockLinkAsync(_block.GetHash()); await _blockManager.RemoveBlockAsync(_block.GetHash()); await _chains.SetAsync(_chain.Id.ToStorageKey(), _chain); }
public async Task IterationCleanup() { await _blockStateSets.RemoveAsync(_block.GetHash().ToStorageKey()); foreach (var tx in _block.Body.Transactions) { _transactionManager.RemoveTransaction(tx); _transactionResultManager.RemoveTransactionResultAsync(tx, _block.GetHash()); _transactionResultManager.RemoveTransactionResultAsync(tx, _block.Header.GetPreMiningHash()); } await _chainManager.RemoveChainBlockLinkAsync(_block.GetHash()); await _blockManager.RemoveBlockAsync(_block.GetHash()); await _chains.SetAsync(_chain.Id.ToStorageKey(), _chain); }
public async Task GlobalCleanup() { foreach (var block in _blocks) { await _transactionPoolService.CleanByTransactionIdsAsync(block.TransactionIds); await _transactionManager.RemoveTransactionsAsync(block.Body.TransactionIds); await RemoveTransactionResultsAsync(block.Body.TransactionIds, block.GetHash()); await _chainManager.RemoveChainBlockLinkAsync(block.GetHash()); await _blockManager.RemoveBlockAsync(block.GetHash()); } await _transactionPoolService.UpdateTransactionPoolByBestChainAsync(_chain.BestChainHash, _chain.BestChainHeight); await _chains.SetAsync(_chain.Id.ToStorageKey(), _chain); }
public async Task IterationCleanup() { await _txHub.HandleBlockAcceptedAsync(new BlockAcceptedEvent { Block = _block }); await _txHub.HandleBestChainFoundAsync(new BestChainFoundEventData { BlockHash = _chain.BestChainHash, BlockHeight = _chain.BestChainHeight }); await _transactionManager.RemoveTransactionsAsync(_block.Body.TransactionIds); await _chainManager.RemoveChainBlockLinkAsync(_block.GetHash()); await _blockManager.RemoveBlockAsync(_block.GetHash()); await _chains.SetAsync(_chain.Id.ToStorageKey(), _chain); }