Change blob_wants from a table to a view. We can discover the information pretty fast, so let's not store extra data.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4125 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-01-14 23:25:56 +00:00
parent 9248dfd97e
commit 0cbc1a650b
2 changed files with 36 additions and 43 deletions

View File

@ -136,7 +136,7 @@ static void _tf_ssb_rpc_request_more_blobs(tf_ssb_connection_t* connection)
tf_ssb_t* ssb = tf_ssb_connection_get_ssb(connection);
sqlite3* db = tf_ssb_get_db(ssb);
sqlite3_stmt* statement;
if (sqlite3_prepare(db, "SELECT id FROM blob_wants WHERE id > ? ORDER BY id LIMIT 32", -1, &statement, NULL) == SQLITE_OK)
if (sqlite3_prepare(db, "SELECT id FROM blob_wants_view WHERE id > ? ORDER BY id LIMIT 32", -1, &statement, NULL) == SQLITE_OK)
{
if (sqlite3_bind_text(statement, 1, blob_wants->last_id, -1, NULL) == SQLITE_OK)
{