Permalink
Browse files

prevent available from going negative

  • Loading branch information...
1 parent 54cfbf7 commit 5248899c3328447b04d6ba6a8669aad280aaf0f6 Rafael H. Schloming committed Feb 9, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 link.py
View
@@ -293,7 +293,7 @@ def do_transfer(self, xfr):
u = self._units(xfr)
self.link_credit -= u
self.transfer_count += u
- self.available -= u
+ self.available = max(0, self.available - u)
def do_flow_state(self, state):
if self.transfer_count is not None:

0 comments on commit 5248899

Please sign in to comment.