From 820a0a600cb8fe2432374a3691e76940f6726044 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Mon, 26 Apr 2021 00:48:53 +0300 Subject: Bugfix --- src/handlers.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/handlers.rs') diff --git a/src/handlers.rs b/src/handlers.rs index e37cb40..ed95604 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -646,6 +646,18 @@ pub async fn propose_transaction( } }; + if internal_user.is_bot { + debug!("Someone tried to send as the bot"); + + return Ok(warp::reply::with_status( + warp::reply::json(&GradeCoinResponse { + res: ResponseType::Error, + message: "Don's send transactions on behalf of bots".to_owned(), + }), + StatusCode::BAD_REQUEST, + )); + } + // `internal_user` is an authenticated student, can propose // This public key was already written to the database, we can panic if it's not valid at -- cgit v1.2.3-70-g09d2