diff --git a/src/ssb.rpc.c b/src/ssb.rpc.c index f0ac5d6f..3406dd87 100644 --- a/src/ssb.rpc.c +++ b/src/ssb.rpc.c @@ -760,7 +760,7 @@ static void _tf_ssb_connection_send_history_stream_work(tf_ssb_connection_t* con sqlite3* db = tf_ssb_acquire_db_reader(ssb); sqlite3_stmt* statement; const int k_max = 32; - if (sqlite3_prepare(db, "SELECT previous, author, id, sequence, timestamp, hash, content, signature, sequence_before_author FROM messages WHERE author = ?1 AND sequence >= ?2 AND sequence < ?3 ORDER BY sequence", -1, &statement, NULL) == SQLITE_OK) + if (sqlite3_prepare(db, "SELECT previous, author, id, sequence, timestamp, hash, content, signature, sequence_before_author FROM messages WHERE author = ?1 AND sequence > ?2 AND sequence < ?3 ORDER BY sequence", -1, &statement, NULL) == SQLITE_OK) { if (sqlite3_bind_text(statement, 1, request->author, -1, NULL) == SQLITE_OK && sqlite3_bind_int64(statement, 2, request->sequence) == SQLITE_OK && @@ -835,7 +835,7 @@ static void _tf_ssb_connection_send_history_stream_after_work(tf_ssb_connection_ } if (!request->out_finished) { - _tf_ssb_connection_send_history_stream(connection, request->request_number, request->author, request->out_max_sequence_seen + 1, request->keys, request->live); + _tf_ssb_connection_send_history_stream(connection, request->request_number, request->author, request->out_max_sequence_seen, request->keys, request->live); } else if (!request->live) {