Spawning of multiple wallets
In c7c99b60 I already implemented the possibility to spawn wallets without a GUI. When I tried to create multiple wallets (> 10), I noticed that it doesn't work at the moment.
The problem seems to be related to the supervisor reference which the wallets send to newly joined nodes At the application start, a lot of wallets join the network really fast. Every created wallet has the previously created wallet set as their preknown neighbour. This preknown neighbour is requested to send its supervisor reference (along with its neighbours) to the joined wallet. Now, the main issue is, that the preknown neighbour doesn't know the supervisor itself the moment it is requested to send it to the new node. As a consquence, the new wallet receives a null
reference instead of an actual supervisor reference and therefore can't register in the network.
A simple (and quite dirty fix) would be to just add a delay when spawning new wallets. Obviously this does not scale very well.. Akka futures [1] seem to be a much better and cleaner solution, though I am not entirely sure if they are feasible for our scenario.