From 40083923ed74eb026135d78600ebf55ff0a9e32c Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 1 Sep 2014 15:12:27 -0700 Subject: Support BIP32 HD Wallets --- routes/users.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'routes') diff --git a/routes/users.js b/routes/users.js index 50db4ec5..2e94f027 100644 --- a/routes/users.js +++ b/routes/users.js @@ -18,13 +18,16 @@ }); }, json: function(req, res) { - return db.hgetall("user:" + req.params.user, function(err, obj) { - delete obj['password']; - res.writeHead(200, { - "Content-Type": "application/json" + return db.llen("" + req.params.user + ":transactions", function(err, len) { + return db.hgetall("user:" + req.params.user, function(err, obj) { + delete obj['password']; + obj['index'] = len; + res.writeHead(200, { + "Content-Type": "application/json" + }); + res.write(JSON.stringify(obj)); + return res.end(); }); - res.write(JSON.stringify(obj)); - return res.end(); }); }, show: function(req, res) { -- cgit v1.2.3