示例#1
0
 def doWriteCoins(self, arg):
     """
     Action method.
     """
     for coin in arg:
         if not coins_db.exist(coin):
             coins_db.insert(coin)
         if coin["tm"] > utime.datetime_to_sec1970(self.download_offset):
             self.download_offset = utime.sec1970_to_datetime_utc(coin["tm"])
示例#2
0
 def doRetreiveCoins(self, arg):
     """
     Action method.
     """
     query = {
         "method": "get_all",
         "index": "time",
         "limit": self.download_limit,
         "start": utime.datetime_to_sec1970(self.download_offset),
         "end": utime.utcnow_to_sec1970(),
     }
     for idurl in self.connected_accountants:
         p2p_service.SendRetreiveCoin(idurl, query)