fix(db/trans-cache): avoid recovering a wrong cached data by halibobo1205 · Pull Request #5505 · tronprotocol/java-tron

Avoid downgrading and then upgrading to use the wrong data for cache recovery

For the following cases :

  1. start node with 4.7.3
  2. stop node with kill -15 : dump trans-cache data on header x
  3. start node with 4.7.2
  4. stop node on header y(y>x)
  5. start node with 4.7.3: recover trans-cache data with header x, DupTransactionException will possibly occur.

How to fix

Check header when recovering cached data.