File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -285,10 +285,16 @@ def invalid!
285285 uncle_blocks . delete_all
286286 # delete_address_txs_cache
287287 ckb_transaction_ids = ckb_transactions . pluck ( :id )
288+ tx_hashes = ckb_transactions . pluck ( :tx_hash )
288289 CellOutput . where ( ckb_transaction_id : ckb_transaction_ids ) . delete_all
289290 CellInput . where ( ckb_transaction_id : ckb_transaction_ids ) . delete_all
290291 AccountBook . where ( ckb_transaction_id : ckb_transaction_ids ) . delete_all
291292 CellDependency . where ( ckb_transaction_id : ckb_transaction_ids ) . delete_all
293+ cell_deps = CellDepsOutPoint . where ( tx_hash : tx_hashes ) . select ( :tx_hash , :cell_index )
294+ cell_deps . each do |cell_dep |
295+ Rails . cache . delete ( [ "CellOutput" , cell_dep . tx_hash , cell_dep . cell_index ] )
296+ end
297+
292298 HeaderDependency . where ( ckb_transaction_id : ckb_transaction_ids ) . delete_all
293299 TokenTransfer . where ( transaction_id : ckb_transaction_ids ) . delete_all
294300 Witness . where ( ckb_transaction_id : ckb_transaction_ids ) . delete_all
You can’t perform that action at this time.
0 commit comments