summaryrefslogtreecommitdiff
path: root/data/pools/statusCache.go
diff options
context:
space:
mode:
Diffstat (limited to 'data/pools/statusCache.go')
-rw-r--r--data/pools/statusCache.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/data/pools/statusCache.go b/data/pools/statusCache.go
index 0b8d96741..c8977e3fc 100644
--- a/data/pools/statusCache.go
+++ b/data/pools/statusCache.go
@@ -1,4 +1,4 @@
-// Copyright (C) 2019-2023 Algorand, Inc.
+// Copyright (C) 2019-2024 Algorand, Inc.
// This file is part of go-algorand
//
// go-algorand is free software: you can redistribute it and/or modify
@@ -52,7 +52,7 @@ func (sc *statusCache) check(txid transactions.Txid) (tx transactions.SignedTxn,
func (sc *statusCache) put(tx transactions.SignedTxn, txErr string) {
if len(sc.cur) >= sc.sz {
sc.prev = sc.cur
- sc.cur = map[transactions.Txid]statusCacheEntry{}
+ sc.cur = make(map[transactions.Txid]statusCacheEntry, sc.sz)
}
sc.cur[tx.ID()] = statusCacheEntry{
@@ -62,6 +62,6 @@ func (sc *statusCache) put(tx transactions.SignedTxn, txErr string) {
}
func (sc *statusCache) reset() {
- sc.cur = map[transactions.Txid]statusCacheEntry{}
- sc.prev = map[transactions.Txid]statusCacheEntry{}
+ sc.cur = make(map[transactions.Txid]statusCacheEntry, sc.sz)
+ sc.prev = nil
}