refactor(fingerprint): minor changes
This commit is contained in:
parent
f37b210c2e
commit
9c47c9df9b
1 changed files with 4 additions and 9 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue