diff --git a/app/models/ckb_transaction.rb b/app/models/ckb_transaction.rb index a2f63c7eb..e8f6b6863 100644 --- a/app/models/ckb_transaction.rb +++ b/app/models/ckb_transaction.rb @@ -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?