http.
This commit is contained in:
parent
90aa2d81a6
commit
d83a68523e
@ -460,6 +460,21 @@ NodeServer.prototype._init = function _init() {
|
||||
});
|
||||
});
|
||||
|
||||
// Mempool snapshot
|
||||
this.get('/mempool', function(req, res, next, send) {
|
||||
self.node.mempool.getAll(function(err, txs) {
|
||||
if (err)
|
||||
return callback(err);
|
||||
|
||||
if (!txs.length)
|
||||
return send(404);
|
||||
|
||||
send(200, txs.map(function(tx) {
|
||||
return tx.toJSON();
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
this.server.on('error', function(err) {
|
||||
self.emit('error', err);
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user