Skip to content

Commit

Permalink
simulation: correct the Cancel fee overpayment computation
Browse files Browse the repository at this point in the history
  • Loading branch information
darosior committed Sep 30, 2021
1 parent 11e59c0 commit c5ad47a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Model/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
# with_fb_coins_dist=True,
with_cum_op_cost=True,
with_divergence=True,
# with_overpayments=True,
with_overpayments=True,
)

start_block = 350000
Expand Down
3 changes: 2 additions & 1 deletion Model/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ def cancel(self, block_height):
# Compute overpayments
if self.with_overpayments:
feerate = self.wt.next_block_feerate(block_height)
self.overpayments.append([block_height, self.cancel_fee - feerate])
needed_fee = self.wt.cancel_tx_fee(feerate, len(cancel_inputs))
self.overpayments.append([block_height, self.cancel_fee - needed_fee])

def catastrophe_sequence(self, block_height):
if len(self.wt.list_available_vaults()) == 0:
Expand Down

0 comments on commit c5ad47a

Please sign in to comment.