From 4037e3752b8124f3c2e99bfd47acc8eb76d63b53 Mon Sep 17 00:00:00 2001 From: 4tochka Date: Mon, 13 May 2019 15:23:23 +0400 Subject: [PATCH] connector --- pybtc/connector/utxo.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pybtc/connector/utxo.py b/pybtc/connector/utxo.py index e4d3f25..16ed285 100644 --- a/pybtc/connector/utxo.py +++ b/pybtc/connector/utxo.py @@ -60,7 +60,12 @@ class UTXO(): block_changed = True lb = i[1][0] >> 42 if lb - 1 == checkpoint: - checkpoint_found = True + if len(self.cached) > self.size_limit: + if self.checkpoints: + checkpoint = self.checkpoints.pop() + else: + checkpoint_found = True + if len(self.cached) <= self.size_limit: if block_changed and checkpoint_found: