From f149f09bf77bff7fc3a24bd4448ef8dea6e049a9 Mon Sep 17 00:00:00 2001 From: Ozan Akın Date: Mon, 18 Apr 2022 21:11:07 +0300 Subject: fix overwriting the reciprocated transaction during block acceptance --- src/handlers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handlers.rs b/src/handlers.rs index ca0608c..055ca22 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -573,7 +573,7 @@ pub async fn propose_block( // if the receiver is a bot, they will reciprocate if users_store.get(target).unwrap().is_bot { let transaction_id = calculate_transaction_id(target, source); - pending_transactions.insert( + holding.insert( transaction_id, Transaction { source: target.clone(), -- cgit v1.2.3-70-g09d2 From f3073c4ed82d9b946048f387e7430d8d803cd114 Mon Sep 17 00:00:00 2001 From: Ozan Akın Date: Mon, 18 Apr 2022 21:18:01 +0300 Subject: add the forgotten `mut` to variable holding --- src/handlers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/handlers.rs b/src/handlers.rs index 055ca22..23adffb 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -554,7 +554,7 @@ pub async fn propose_block( coinbase_user.balance += BLOCK_REWARD; } - let holding: HashMap = HashMap::new(); + let mut holding: HashMap = HashMap::new(); // Play out the transactions for fingerprint in &new_block.transaction_list { -- cgit v1.2.3-70-g09d2