Skip to content

Commit

Permalink
feat: update block's contained addresses's transactions count
Browse files Browse the repository at this point in the history
even if fee is a negative number
  • Loading branch information
shaojunda committed Aug 18, 2019
1 parent c38336f commit 77c6da2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/ckb_sync/node_data_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ def calculate_tx_fee(local_block)
local_block.total_transaction_fee = local_block.ckb_transactions.sum(:transaction_fee)
local_block.save!
end
rescue ActiveRecord::RecordInvalid
local_block.update(total_transaction_fee: 0)
Rails.logger.error "tx_fee is negative"
end

def update_transaction_fee(ckb_transaction)
Expand Down

0 comments on commit 77c6da2

Please sign in to comment.