From e7e4ec795b0975a82c3b4b96f8e8a93712f3d91a Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 5 May 2021 15:31:25 +0300 Subject: Bot tx bugfix --- src/handlers.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/handlers.rs b/src/handlers.rs index 839443d..c7457c4 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -559,6 +559,8 @@ pub async fn propose_block( coinbase_user.balance += BLOCK_REWARD; } + let holding: HashMap = HashMap::new(); + // Play out the transactions for fingerprint in new_block.transaction_list.iter() { if let Some(transaction) = pending_transactions.remove(fingerprint) { @@ -590,6 +592,10 @@ pub async fn propose_block( } } + for (fp, tx) in holding.iter() { + pending_transactions.insert(fp.to_owned(), tx.to_owned()); + } + // just update everyone's .guy file for (fp, guy) in users_store.iter() { if !guy.is_bot { @@ -877,7 +883,10 @@ fn authorize_proposer(jwt_token: String, user_pem: &str) -> Result { - warn!("AN UNSPECIFIED ERROR from token: {}\nerr: {:?} key was {}", jwt_token, err, user_pem); + warn!( + "AN UNSPECIFIED ERROR from token: {}\nerr: {:?} key was {}", + jwt_token, err, user_pem + ); return Err(format!("JWT Error: {}", err)); } }, -- cgit v1.2.3-70-g09d2