Skip to content

Commit

Permalink
fix: pending transaction income
Browse files Browse the repository at this point in the history
  • Loading branch information
rabbitz committed Dec 21, 2023
1 parent eb74028 commit a77bb1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/ckb_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,11 @@ def cell_deps
end

def income(address)
outputs.where(address: address).sum(:capacity) - inputs.where(address: address).sum(:capacity)
if tx_pending?
cell_outputs.where(address: address).sum(:capacity) - input_cells.where(address: address).sum(:capacity)
else
outputs.where(address: address).sum(:capacity) - inputs.where(address: address).sum(:capacity)
end
end

def dao_transaction?
Expand Down

0 comments on commit a77bb1b

Please sign in to comment.