update LiveStreamPaymentRateManager

This commit is contained in:
Jack 2016-10-03 16:54:46 -04:00
parent 180d981ed8
commit dc2f0adb3e

View file

@ -19,11 +19,13 @@ class LiveStreamPaymentRateManager(object):
def accept_rate_live_blob_info(self, peer, payment_rate):
return payment_rate >= self.get_effective_min_live_blob_info_payment_rate()
def get_rate_blob_data(self, peer):
return self.get_effective_min_blob_data_payment_rate()
def get_rate_blob_data(self, peer, blobs):
response = self._payment_rate_manager.strategy.make_offer(peer, blobs)
return response.rate
def accept_rate_blob_data(self, peer, payment_rate):
return payment_rate >= self.get_effective_min_blob_data_payment_rate()
def accept_rate_blob_data(self, peer, blobs, offer):
response = self._payment_rate_manager.strategy.respond_to_offer(offer, peer, blobs)
return response.accepted
def get_effective_min_blob_data_payment_rate(self):
rate = self.min_blob_data_payment_rate
@ -42,4 +44,4 @@ class LiveStreamPaymentRateManager(object):
return rate
def record_points_paid(self, amount):
self.points_paid += amount
self.points_paid += amount