From 9f28e94d66a28beb6e6000a095b001c8ed146818 Mon Sep 17 00:00:00 2001 From: Austin Roberts Date: Fri, 7 Jan 2022 11:36:30 -0600 Subject: [PATCH] Fix memory leak in freezer implementation It turns out we were only notifying plugins of freezer commits and cleaning up our record when the block being processed was greater than MAX_UINT64. So, uh, never. --- core/rawdb/plugin_hooks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/rawdb/plugin_hooks.go b/core/rawdb/plugin_hooks.go index 1845408cb..3de55cc40 100644 --- a/core/rawdb/plugin_hooks.go +++ b/core/rawdb/plugin_hooks.go @@ -39,7 +39,7 @@ func PluginCommitUpdate(pl *plugins.PluginLoader, num uint64) { if freezerUpdates == nil { freezerUpdates = make(map[uint64]map[string]interface{}) } min := ^uint64(0) for i := range freezerUpdates{ - if min < i { min = i } + if min > i { min = i } } for i := min ; i < num; i++ { update, ok := freezerUpdates[i]