1
0

reorganize with_lock decorator

This commit is contained in:
bitromortac
2021-03-22 08:25:26 +01:00
parent 92226b077a
commit 63308f94a0
4 changed files with 13 additions and 23 deletions

View File

@@ -29,7 +29,7 @@ from . import util
from .bitcoin import hash_encode, int_to_hex, rev_hex
from .crypto import sha256d
from . import constants
from .util import bfh, bh2u
from .util import bfh, bh2u, with_lock
from .simple_config import SimpleConfig
from .logging import get_logger, Logger
@@ -195,12 +195,6 @@ class Blockchain(Logger):
self.lock = threading.RLock()
self.update_size()
def with_lock(func):
def func_wrapper(self, *args, **kwargs):
with self.lock:
return func(self, *args, **kwargs)
return func_wrapper
@property
def checkpoints(self):
return constants.net.CHECKPOINTS