diff --git a/bitdust/customer/supplier_connector.py b/bitdust/customer/supplier_connector.py index 662174776..cfa36de48 100644 --- a/bitdust/customer/supplier_connector.py +++ b/bitdust/customer/supplier_connector.py @@ -164,6 +164,7 @@ def total_connectors(): class SupplierConnector(automat.Automat): + """ This class implements all the functionality of the ``supplier_connector()`` state machine. @@ -607,6 +608,8 @@ def doDestroyMe(self, *args, **kwargs): self.destroy() def _supplier_service_acked(self, response, info): + if _Debug: + lg.args(_DebugLevel, response=response, info=info) if not self.request_packet_id: lg.warn('received "old" response : %r' % response) return @@ -623,7 +626,6 @@ def _supplier_service_acked(self, response, info): lg.exc() if _Debug: lg.args(_DebugLevel, response=response, info=info, contract=the_contract) - self.storage_contract = the_contract if the_contract: if not accounting.verify_storage_contract(the_contract): lg.err('received storage contract from %r is not valid' % self.supplier_idurl) @@ -632,6 +634,7 @@ def _supplier_service_acked(self, response, info): return from bitdust.customer import payment payment.save_storage_contract(self.supplier_idurl, the_contract) + self.storage_contract = the_contract self.automat('ack', response) def _supplier_service_failed(self, response, info): diff --git a/bitdust/interface/api.py b/bitdust/interface/api.py index 01951e11b..380b5f611 100644 --- a/bitdust/interface/api.py +++ b/bitdust/interface/api.py @@ -4463,10 +4463,7 @@ def suppliers_list(customer_id=None, verbose=False): customer_idurl = global_id.GlobalUserToIDURL(customer_id, as_field=False) customer_idurl = id_url.field(customer_idurl) results = [] - for ( - pos, - supplier_idurl, - ) in enumerate(contactsdb.suppliers(customer_idurl)): + for pos, supplier_idurl in enumerate(contactsdb.suppliers(customer_idurl)): if not supplier_idurl: r = { 'position': pos,