diff --git a/lib/collection.js b/lib/collection.js index 9f625ab..422cd12 100644 --- a/lib/collection.js +++ b/lib/collection.js @@ -15,6 +15,19 @@ var Collection = function Collection(externalAPI) return this; } +Collection.prototype.setupSockets = function() +{ + this._externalAPI.on('connection', function (spark) + { + this._externalAPI.on('latestBlock', function (data) + { + spark.emit('latestBlock', { + number: this._highestBlock + }); + }); + }); +} + Collection.prototype.add = function(data, callback) { var node = this.getNodeOrNew({ id : data.id }, data);