Skip to content

Commit

Permalink
avoids decoding database flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Elod23 committed Aug 4, 2023
1 parent e68282e commit 5b9e53f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ func (m *RemoveNonceTxIndexAddFeeMigration) Apply(s *pebble.Storage) error {
var o OldTransaction
count := 0
s.ForEachFromKey([]byte(pebble.TransactionPrefix), last_key, func(key, res []byte) (stop bool) {
if len(res) < 100 {
return false
}
err := rlp.DecodeBytes(res, &o)
if err != nil {
if err.Error() == "rlp: too few elements for migration.OldTransaction" {
Expand All @@ -52,9 +55,6 @@ func (m *RemoveNonceTxIndexAddFeeMigration) Apply(s *pebble.Storage) error {
if err.Error() == "rlp: input string too long for uint64, decoding into (migration.OldTransaction).GasUsed" {
return false
}
if err.Error() == "rlp: expected input list for migration.OldTransaction" {
return false
}
log.WithFields(log.Fields{"migration": m.id, "error": err}).Fatal("Error decoding Transaction")
}
tx := models.Transaction{
Expand Down

0 comments on commit 5b9e53f

Please sign in to comment.