Skip to content

Commit 973430f

Browse files
committed
allowlist store
1 parent c1b3b6c commit 973430f

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

  • core/services/gateway/handlers/functions/allowlist

core/services/gateway/handlers/functions/allowlist/allowlist.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,12 @@ func (a *onchainAllowlist) updateAllowedSendersBatch(
343343
for _, addr := range allowedSendersBatch {
344344
currentAllowedSenderList[addr] = struct{}{}
345345
}
346-
a.allowlist.Store(&currentAllowedSenderList)
346+
347+
snapshot := make(map[common.Address]struct{}, len(currentAllowedSenderList))
348+
for k, v := range currentAllowedSenderList {
349+
snapshot[k] = v
350+
}
351+
a.allowlist.Store(&snapshot)
347352
a.lggr.Infow("allowlist updated in batches successfully", "len", len(currentAllowedSenderList))
348353

349354
// persist each batch to the underalying orm layer

0 commit comments

Comments
 (0)