Skip to content

Commit

Permalink
prevent available from going negative
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael H. Schloming committed Feb 9, 2011
1 parent 54cfbf7 commit 5248899
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion link.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5248899

Please sign in to comment.