AddressProperty for totalSent

This commit is contained in:
Ian Coleman 2014-03-21 13:04:44 +11:00
parent f88fdff88c
commit 306f2cd1e3
2 changed files with 14 additions and 0 deletions

View File

@ -45,3 +45,16 @@ exports.totalReceived = function(req, res, next) {
}
});
};
exports.totalSent = function(req, res, next) {
var a = getAddr(req, res, next);
if (a)
a.update(function(err) {
if (err) {
return common.handleErrors(err, res);
}
else {
return res.jsonp(a.totalSentSat);
}
});
};

View File

@ -36,6 +36,7 @@ module.exports = function(app) {
var addressProperties = require('../app/controllers/addressProperties.js');
app.get(apiPrefix + '/addr/:addr/balance', addressProperties.balance);
app.get(apiPrefix + '/addr/:addr/totalReceived', addressProperties.totalReceived);
app.get(apiPrefix + '/addr/:addr/totalSent', addressProperties.totalSent);
// Status route
var st = require('../app/controllers/status');