aboutsummaryrefslogtreecommitdiffstats
path: root/src/handlers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/handlers.rs')
-rw-r--r--src/handlers.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/handlers.rs b/src/handlers.rs
index 856970d..256e72a 100644
--- a/src/handlers.rs
+++ b/src/handlers.rs
@@ -58,6 +58,24 @@ pub async fn propose_transaction(
58 Ok(StatusCode::CREATED) 58 Ok(StatusCode::CREATED)
59} 59}
60 60
61/// POST /transaction, authenticated
62/// The transaction arrived in this method has been authored by the public key in the source
63pub async fn propose_authenticated_transaction(
64 pubkey: String,
65 new_transaction: Transaction,
66 db: Db,
67) -> Result<impl warp::Reply, warp::Rejection> {
68 debug!("new transaction request {:?}", new_transaction);
69
70 // let mut transactions = db.lock().await;
71 let mut transactions = db.pending_transactions.write();
72
73 transactions.insert(new_transaction.source.to_owned(), new_transaction);
74
75 Ok(StatusCode::CREATED)
76}
77
78
61/// POST /block 79/// POST /block
62/// Proposes a new block for the next round 80/// Proposes a new block for the next round
63/// Can reject the block 81/// Can reject the block