Fixed wrong pointer

Andrea Zoppi
Stack optimization

Andrea Zoppi
Added node state; shutdown moved to Node thread

By moving the shutdown() management to the Node thread, the stack usage has
been optimized.

Andrea Zoppi