From 09cd9ec49ac408049f32cb4fb20d40ee89d21f08 Mon Sep 17 00:00:00 2001 From: Martin Klepsch Date: Mon, 16 Apr 2018 14:58:18 +0200 Subject: [PATCH] fix bug --- src/clj/commiteth/eth/core.clj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/clj/commiteth/eth/core.clj b/src/clj/commiteth/eth/core.clj index 92e66df..3156543 100644 --- a/src/clj/commiteth/eth/core.clj +++ b/src/clj/commiteth/eth/core.clj @@ -73,13 +73,15 @@ DefaultBlockParameterName/LATEST) sendAsync get - getTransactionCount)] + getTransactionCount) + nonce (if (contains? nonces web3j-tx-count) + (inc (max nonces)) + web3j-tx-count)] ;; TODO this is a memory leak since tracking state is never pruned ;; Since we're not doing 1000s of transactions every day yet we can ;; probably defer worrying about this until a bit later - (if (contains? nonces web3j-tx-count) - (swap! state assoc internal-tx-id (inc (max nonces))) - (swap! state assoc internal-tx-id web3j-tx-count)))))) + (swap! state assoc internal-tx-id nonce) + nonce)))) (def nonce-tracker (->NonceTracker (atom {})))