Skip to content

Commit

Permalink
fix in bitdust/customer/supplier_connector.py
Browse files Browse the repository at this point in the history
  • Loading branch information
vesellov committed May 1, 2024
1 parent 4608753 commit 2ed5924
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 4 additions & 1 deletion bitdust/customer/supplier_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def total_connectors():


class SupplierConnector(automat.Automat):

"""
This class implements all the functionality of the ``supplier_connector()``
state machine.
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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):
Expand Down
5 changes: 1 addition & 4 deletions bitdust/interface/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2ed5924

Please sign in to comment.