fix(announce): fixed announce issue for get current peer

This commit is contained in:
OldHawk
2018-05-01 12:28:30 +08:00
parent b93e6a8f96
commit f5557ee22c

View File

@@ -887,10 +887,10 @@ exports.announce = function (req, res) {
if (req.seeder && req.currentPeer.peer_status !== PEERSTATE_SEEDER && event(query.event) !== EVENT_COMPLETED) {
mtDebug.debugGreen('---------------PEER STATUS CHANGED: Seeder----------------', 'ANNOUNCE', true, req.passkeyuser);
doCompleteEvent(function () {
if (callback) callback();
if (callback) return callback();
});
} else {
if (callback) callback();
if (callback) return callback();
}
}
});
@@ -898,7 +898,7 @@ exports.announce = function (req, res) {
//if not found then create req.currentPeer
if (!req.currentPeer) {
createCurrentPeer(function () {
if (callback) callback();
if (callback) return callback();
});
}
}