@@ -15,7 +15,7 @@ import io.iohk.ethereum.ledger._
15
15
import io .iohk .ethereum .mpt .MerklePatriciaTrie .MissingNodeException
16
16
import io .iohk .ethereum .network .PeerId
17
17
import io .iohk .ethereum .network .p2p .messages .CommonMessages .NewBlock
18
- import io .iohk .ethereum .ommers .OmmersPool .{ AddOmmers , RemoveOmmers }
18
+ import io .iohk .ethereum .ommers .OmmersPool .AddOmmers
19
19
import io .iohk .ethereum .transactions .PendingTransactionsManager
20
20
import io .iohk .ethereum .transactions .PendingTransactionsManager .{AddUncheckedTransactions , RemoveTransactions }
21
21
import io .iohk .ethereum .utils .ByteStringUtils
@@ -221,17 +221,16 @@ class BlockImporter(
221
221
case BlockImportedToTop (importedBlocksData) =>
222
222
val (blocks, tds) = importedBlocksData.map(data => (data.block, data.td)).unzip
223
223
broadcastBlocks(blocks, tds)
224
- updateTxAndOmmerPools (importedBlocksData.map(_.block), Seq .empty)
224
+ updateTxPool (importedBlocksData.map(_.block), Seq .empty)
225
225
226
- case BlockEnqueued =>
227
- ommersPool ! AddOmmers (block.header)
226
+ case BlockEnqueued => ()
228
227
229
228
case DuplicateBlock => ()
230
229
231
230
case UnknownParent => () // This is normal when receiving broadcast blocks
232
231
233
232
case ChainReorganised (oldBranch, newBranch, totalDifficulties) =>
234
- updateTxAndOmmerPools (newBranch, oldBranch)
233
+ updateTxPool (newBranch, oldBranch)
235
234
broadcastBlocks(newBranch, totalDifficulties)
236
235
237
236
case BlockImportFailed (error) =>
@@ -256,12 +255,9 @@ class BlockImporter(
256
255
257
256
private def broadcastNewBlocks (blocks : List [NewBlock ]): Unit = broadcaster ! BroadcastBlocks (blocks)
258
257
259
- private def updateTxAndOmmerPools (blocksAdded : Seq [Block ], blocksRemoved : Seq [Block ]): Unit = {
260
- blocksRemoved.headOption.foreach(block => ommersPool ! AddOmmers (block.header))
258
+ private def updateTxPool (blocksAdded : Seq [Block ], blocksRemoved : Seq [Block ]): Unit = {
261
259
blocksRemoved.foreach(block => pendingTransactionsManager ! AddUncheckedTransactions (block.body.transactionList))
262
-
263
260
blocksAdded.foreach { block =>
264
- ommersPool ! RemoveOmmers (block.header :: block.body.uncleNodesList.toList)
265
261
pendingTransactionsManager ! RemoveTransactions (block.body.transactionList)
266
262
}
267
263
}
0 commit comments