Skip to content

Commit

Permalink
fix: Use correct deposit out point to calculate withdraws
Browse files Browse the repository at this point in the history
  • Loading branch information
xxuejie authored and shaojunda committed Oct 31, 2019
1 parent f30f244 commit 5f39400
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ckb/wallet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def start_withdrawing_from_dao(out_point, key: nil, fee: 0)
# @param fee [Integer]
#
# @return [CKB::Type::Transaction]
def generate_withdraw_from_dao_transaction(withdrawing_out_point, key: nil, fee: 0)
def generate_withdraw_from_dao_transaction(deposit_out_point, withdrawing_out_point, key: nil, fee: 0)
key = get_key(key)

cell_status = api.get_live_cell(withdrawing_out_point, true)
Expand Down Expand Up @@ -293,7 +293,7 @@ def generate_withdraw_from_dao_transaction(withdrawing_out_point, key: nil, fee:
minimal_since = self.class.epoch_since(minimal_since_epoch_length, minimal_since_epoch_index, minimal_since_epoch_number)

# a hex string
output_capacity = api.calculate_dao_maximum_withdraw(withdrawing_out_point.dup, withdraw_block.hash).hex
output_capacity = api.calculate_dao_maximum_withdraw(deposit_out_point.dup, withdraw_block.hash).hex

outputs = [
Types::Output.new(capacity: output_capacity - fee, lock: lock)
Expand Down

0 comments on commit 5f39400

Please sign in to comment.