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?
You are viewing a single comment's thread from:
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?
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.