Skip to content

Commit

Permalink
Optimize payload filtering in state extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
fxamacker committed Feb 13, 2024
1 parent 392b842 commit 7477666
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cmd/util/ledger/util/payload_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,14 @@ func includePayloadByAddresses(payload *ledger.Payload, addresses []common.Addre
return true, nil
}

for _, address := range addresses {
k, err := payload.Key()
if err != nil {
return false, fmt.Errorf("failed to get key from payload: %w", err)
}
k, err := payload.Key()
if err != nil {
return false, fmt.Errorf("failed to get key from payload: %w", err)
}

owner := k.KeyParts[0].Value

owner := k.KeyParts[0].Value
for _, address := range addresses {
if bytes.Equal(owner, address[:]) {
return true, nil
}
Expand Down

0 comments on commit 7477666

Please sign in to comment.