diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/handlers.rs | 12 |
1 files changed, 12 insertions, 0 deletions
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( | |||
| 646 | } | 646 | } |
| 647 | }; | 647 | }; |
| 648 | 648 | ||
| 649 | if internal_user.is_bot { | ||
| 650 | debug!("Someone tried to send as the bot"); | ||
| 651 | |||
| 652 | return Ok(warp::reply::with_status( | ||
| 653 | warp::reply::json(&GradeCoinResponse { | ||
| 654 | res: ResponseType::Error, | ||
| 655 | message: "Don's send transactions on behalf of bots".to_owned(), | ||
| 656 | }), | ||
| 657 | StatusCode::BAD_REQUEST, | ||
| 658 | )); | ||
| 659 | } | ||
| 660 | |||
| 649 | // `internal_user` is an authenticated student, can propose | 661 | // `internal_user` is an authenticated student, can propose |
| 650 | 662 | ||
| 651 | // This public key was already written to the database, we can panic if it's not valid at | 663 | // This public key was already written to the database, we can panic if it's not valid at |
