Skip to content

Commit

Permalink
feat: revert address dao deposit changes after fork
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed Oct 14, 2019
1 parent 32902b6 commit 43d5d29
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/ckb_sync/node_data_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ def invalid_block(local_tip_block)
local_tip_block.invalid!
local_tip_block.contained_addresses.each(&method(:update_address_balance_and_ckb_transactions_count))
revert_block_rewards(local_tip_block)
deposit_to_dao_events = local_tip_block.dao_events.where(event_type: "deposit_to_dao")
deposit_to_dao_events.each do |event|
address = event.address
address.decrement!(:dao_deposit, event.value)
end

local_tip_block
end
Expand Down

0 comments on commit 43d5d29

Please sign in to comment.