This commit is contained in:
Martin Klepsch 2018-04-16 14:58:18 +02:00
parent 70e91932e9
commit 09cd9ec49a
No known key found for this signature in database
GPG Key ID: 1A35E702AD48A9F6
1 changed files with 6 additions and 4 deletions

View File

@ -73,13 +73,15 @@
DefaultBlockParameterName/LATEST) DefaultBlockParameterName/LATEST)
sendAsync sendAsync
get 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 ;; 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 ;; Since we're not doing 1000s of transactions every day yet we can
;; probably defer worrying about this until a bit later ;; probably defer worrying about this until a bit later
(if (contains? nonces web3j-tx-count) (swap! state assoc internal-tx-id nonce)
(swap! state assoc internal-tx-id (inc (max nonces))) nonce))))
(swap! state assoc internal-tx-id web3j-tx-count))))))
(def nonce-tracker (def nonce-tracker
(->NonceTracker (atom {}))) (->NonceTracker (atom {})))