You are viewing a single comment's thread from:

RE: 3rd update of 2022 on BlockTrades work on Hive software

in HiveDevs3 years ago (edited)

I don't pretend to understand how the p2p thread works, but what happens to the data on the "writing_queue" after a certain item, if the blockchain thread signals that item is invalid?

Sort:  

The write_queue is a place where the p2p thread puts stuff temporarily, so that the blockchain code can process it. When the blockchain code runs, it pops the oldest item off the queue, decides whether it is a valid transaction or not, then signals back to the p2p task that put it on the queue abou it's validity.

So these items are always being removed from the queue by the blockchain code, regardless of whether they are valid or invalid. In other words, the write_queue is just a producer/consumer buffer between the two threads.