コード例 #1
0
ファイル: BankServer.py プロジェクト: clawplach/BitBlinder
def initialize():
  """initialize coins and locks"""
  log_msg('Initializing cache.', 3)
  previous, current = BankUtil.get_intervals()
  Globals.Acoins = {previous: [], current: []}
  for i in range(Globals.numberOfSets+1):
    Globals.Acoins[previous].append(set())
    Globals.Acoins[current].append(set())
コード例 #2
0
ファイル: BankServer.py プロジェクト: wallydz/BitBlinder
def initialize():
    """initialize coins and locks"""
    log_msg('Initializing cache.', 3)
    previous, current = BankUtil.get_intervals()
    Globals.Acoins = {previous: [], current: []}
    for i in range(Globals.numberOfSets + 1):
        Globals.Acoins[previous].append(set())
        Globals.Acoins[current].append(set())
コード例 #3
0
ファイル: BankServer.py プロジェクト: clawplach/BitBlinder
def on_new_interval():
  """removes expired acoins and locks from the cache and makes new ones"""
  previous, current = BankUtil.get_intervals()
  log_msg('New interval learned: %s!'%current, 3)
  if Globals.isInitialize:
    Globals.Acoins[current] = []
    for repo in range(Globals.numberOfSets+1):
      #create new ones
      Globals.Acoins[current].append(set())
    del(Globals.Acoins[previous-1])
  else:
    initialize()
    Globals.isInitialize = True
コード例 #4
0
ファイル: BankServer.py プロジェクト: wallydz/BitBlinder
def on_new_interval():
    """removes expired acoins and locks from the cache and makes new ones"""
    previous, current = BankUtil.get_intervals()
    log_msg('New interval learned: %s!' % current, 3)
    if Globals.isInitialize:
        Globals.Acoins[current] = []
        for repo in range(Globals.numberOfSets + 1):
            #create new ones
            Globals.Acoins[current].append(set())
        del (Globals.Acoins[previous - 1])
    else:
        initialize()
        Globals.isInitialize = True