nano-node
nano-node copied to clipboard
Fix a shutdown problem in block_processor
My node crashed occasionally during shutdown with an invalid mutex termination in the block_processor destructor.
The issue is that processing threads are running while the node is tearing down, leading to UB.
processing_thread.join()
occurs in the destructor rather than stop()
, at which point most of the node instance is gone.
The destructor seemed wrong anyway as it calls stop, which the node also calls. The proposed solution is to move the destructor's joining of processing_thread to stop
and remove the destructor.