refactor(fingerprint): minor changes

This commit is contained in:
Damian Mee 2014-09-09 07:01:10 +02:00
parent f37b210c2e
commit 9c47c9df9b

View file

@ -63,14 +63,12 @@ function poll(req, res) {
} }
function trade(req, res) { function trade(req, res) {
var fingerprint = getFingerprint(req); plugins.trade(req.body, getFingerprint(req));
plugins.trade(req.body, fingerprint);
res.json({err: null}); res.json({err: null});
} }
function deviceEvent(req, res) { function deviceEvent(req, res) {
var fingerprint = req.connection.getPeerCertificate().fingerprint; plugins.logEvent(req.body, getFingerprint(req));
plugins.event(req.body, fingerprint);
res.json({err: null}); res.json({err: null});
} }
@ -101,8 +99,7 @@ function verifyTransaction(req, res) {
} }
function send(req, res) { function send(req, res) {
var fingerprint = getFingerprint(req); plugins.sendBitcoins(getFingerprint(req), req.body, function(err, txHash) {
plugins.sendBitcoins(fingerprint, req.body, function(err, txHash) {
res.json({ res.json({
err: err && err.message, err: err && err.message,
txHash: txHash, txHash: txHash,
@ -120,9 +117,7 @@ function pair(req, res) {
getFingerprint(req), getFingerprint(req),
name, name,
function(err) { function(err) {
if (err) { if (err) return res.json(500, { err: err.message });
return res.json(500, { err: err.message });
}
res.json(200); res.json(200);
} }