Skip to content

Commit

Permalink
fix: add default value for reduce in get_unspent_cells
Browse files Browse the repository at this point in the history
  • Loading branch information
classicalliu committed Nov 17, 2019
1 parent f37c702 commit e14901b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ckb/cell_collector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_unspent_cells(lock_hash, need_capacities: nil)
break if need_capacities && total_capacities >= need_capacities
else
results.concat(cells)
total_capacities += cells.map(&:capacity).reduce(:+)
total_capacities += cells.map(&:capacity).reduce(0, :+)
break if need_capacities && total_capacities >= need_capacities
end
current_from = current_to + 1
Expand Down

0 comments on commit e14901b

Please sign in to comment.