Skip to content

Commit

Permalink
fix: clear tx verfy cache when chain reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangsoledad committed Apr 8, 2019
1 parent 6025ce8 commit 3da3e83
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shared/src/chain_state.rs
Expand Up @@ -263,6 +263,10 @@ impl<CI: ChainIndex> ChainState<CI> {
attached.extend(blk.commit_transactions().iter().skip(1).cloned())
}

if !detached.is_empty() {
self.txs_verify_cache.borrow_mut().clear();
}

let retain: Vec<&Transaction> = detached.difference(&attached).collect();

for tx in retain {
Expand Down

0 comments on commit 3da3e83

Please sign in to comment.