Beispiel #1
0
 def doRetrieveCoins(self, *args, **kwargs):
     """
     Action method.
     """
     query = {
         'method': 'get_many',
         'index': 'time_mined',
         '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.SendRetrieveCoin(idurl, query)
 def __init__(self, query_dict):
     """
     """
     self.result = Deferred()
     self.out_packets = {}
     for idurl in contract_chain_consumer.A().connected_accountants:
         single_accountant = Deferred()
         outpacket = p2p_service.SendRetrieveCoin(idurl, query_dict, callbacks={
             commands.Coin(): self._on_coin_received,
             commands.Fail(): self._on_coin_failed,
         })
         assert outpacket.PacketID not in self.out_packets
         self.out_packets[outpacket.PacketID] = single_accountant
     DeferredList(list(self.out_packets.values())).addBoth(self._on_results_collected)
     if _Debug:
         lg.out(_DebugLevel, 'contract_chain_node.Query created to request from %d accountants' % len(self.out_packets))