protected override void OnReceive(object message) { switch (message) { case Import import: OnImport(import.Blocks, import.Verify); break; case FillMemoryPool fill: OnFillMemoryPool(fill.Transactions); break; case Block block: OnInventory(block, false); break; case Transaction[] transactions: { // This message comes from a mempool's revalidation, already relayed foreach (var tx in transactions) { OnInventory(tx, false); } break; } case IInventory inventory: OnInventory(inventory); break; case Idle _: if (MemPool.ReVerifyTopUnverifiedTransactionsIfNeeded(MaxTxToReverifyPerIdle, currentSnapshot)) { Self.Tell(Idle.Instance, ActorRefs.NoSender); } break; } }
protected override void OnReceive(object message) { switch (message) { case Import import: OnImport(import.Blocks); break; case FillMemoryPool fill: OnFillMemoryPool(fill.Transactions); break; case Header[] headers: OnNewHeaders(headers); break; case Block block: Sender.Tell(OnNewBlock(block)); break; case Transaction transaction: Sender.Tell(OnNewTransaction(transaction)); break; case ConsensusPayload payload: Sender.Tell(OnNewConsensus(payload)); break; case Idle _: if (MemPool.ReVerifyTopUnverifiedTransactionsIfNeeded(MaxTxToReverifyPerIdle, currentSnapshot)) { Self.Tell(Idle.Instance, ActorRefs.NoSender); } break; } }