From 5f39400fc799ccd5d167497e4f725d776ca89990 Mon Sep 17 00:00:00 2001 From: Xuejie Xiao Date: Thu, 31 Oct 2019 04:50:48 +0000 Subject: [PATCH] fix: Use correct deposit out point to calculate withdraws --- lib/ckb/wallet.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ckb/wallet.rb b/lib/ckb/wallet.rb index 7dcbb578..0eeae309 100644 --- a/lib/ckb/wallet.rb +++ b/lib/ckb/wallet.rb @@ -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) @@ -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)