Skip to content

Commit

Permalink
Fix: wrong check on incoming messages, need to check signature agains…
Browse files Browse the repository at this point in the history
…t rumor pubkey - changed to float total rating in user table
  • Loading branch information
arkanoider committed Dec 23, 2024
1 parent 7b5f670 commit 87b307d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion migrations/20231005195154_users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CREATE TABLE IF NOT EXISTS users (
category integer not null default 0,
last_trade_index integer not null default 0,
total_reviews integer not null default 0,
total_rating integer not null default 0,
total_rating float not null default 0,
last_rating integer not null default 0,
max_rating integer not null default 0,
min_rating integer not null default 0,
Expand Down
2 changes: 1 addition & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async fn check_trade_index(pool: &Pool<Sqlite>, event: &UnwrappedGift, msg: &Mes
if index > user.last_trade_index
&& msg
.get_inner_message_kind()
.verify_signature(event.sender, sig)
.verify_signature(event.rumor.pubkey, sig)
{
user.last_trade_index = index;
if let Err(e) =
Expand Down

0 comments on commit 87b307d

Please sign in to comment.