On new WebSocket connection, Duniter broadcasts a block
As discussed in duniter/sakia#424, we have a spam problem notably due to the following code:
wssBlock.on('connection', function connection(ws) {
co(function *() {
currentBlock = yield server.dal.getCurrent();
wssBlock.broadcast(JSON.stringify(sanitize(currentBlock, dtos.Block)));
ws.send(JSON.stringify(sanitize(currentBlock, dtos.Block)));
});
});
As we can see, a broadcast is sent on every new connection to the websocket.