|
|
|
@ -662,10 +662,11 @@ const handleGetHistoryRange = function (Env, Server, seq, userId, parsed) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var oldestKnownHash = map.from;
|
|
|
|
|
var untilHash = map.to;
|
|
|
|
|
var desiredMessages = map.count;
|
|
|
|
|
var desiredCheckpoint = map.cpCount;
|
|
|
|
|
var txid = map.txid;
|
|
|
|
|
if (typeof(desiredMessages) !== 'number' && typeof(desiredCheckpoint) !== 'number') {
|
|
|
|
|
if (typeof(desiredMessages) !== 'number' && typeof(desiredCheckpoint) !== 'number' && !untilHash) {
|
|
|
|
|
return void Server.send(userId, [seq, 'ERROR', 'UNSPECIFIED_COUNT', HISTORY_KEEPER_ID]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -674,7 +675,7 @@ const handleGetHistoryRange = function (Env, Server, seq, userId, parsed) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Server.send(userId, [seq, 'ACK']);
|
|
|
|
|
Env.getOlderHistory(channelName, oldestKnownHash, desiredMessages, desiredCheckpoint, function (err, toSend) {
|
|
|
|
|
Env.getOlderHistory(channelName, oldestKnownHash, untilHash, desiredMessages, desiredCheckpoint, function (err, toSend) {
|
|
|
|
|
if (err && err.code !== 'ENOENT') {
|
|
|
|
|
Env.Log.error("HK_GET_OLDER_HISTORY", err);
|
|
|
|
|
}
|
|
|
|
|