Skip to content

Commit

Permalink
Remove txn hash check and add capacity to coreReceipts
Browse files Browse the repository at this point in the history
  • Loading branch information
AnkushinDaniil committed Nov 28, 2024
1 parent 1e3d578 commit a9666a8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions p2p/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
junoSync "github.com/NethermindEth/juno/sync"
"github.com/NethermindEth/juno/utils"
"github.com/NethermindEth/juno/utils/pipeline"
"github.com/davecgh/go-spew/spew"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/network"
"github.com/libp2p/go-libp2p/core/peer"
Expand Down Expand Up @@ -289,14 +288,9 @@ func (s *syncService) adaptAndSanityCheckBlock(ctx context.Context, header *spec
txHashEventsM[*txH] = append(txHashEventsM[*txH], p2p2core.AdaptEvent(event))
}

var coreReceipts []*core.TransactionReceipt
coreReceipts := make([]*core.TransactionReceipt, 0, len(receipts))
for i, r := range receipts {
txHash := coreTxs[i].Hash()
if txHash == nil {
spew.Dump(coreTxs[i])
panic(fmt.Errorf("TX hash %d is nil", i))
}
coreReceipts = append(coreReceipts, p2p2core.AdaptReceipt(r, txHash))
coreReceipts = append(coreReceipts, p2p2core.AdaptReceipt(r, coreTxs[i].Hash()))
}
coreReceipts = utils.Map(coreReceipts, func(r *core.TransactionReceipt) *core.TransactionReceipt {
r.Events = txHashEventsM[*r.TransactionHash]
Expand Down

0 comments on commit a9666a8

Please sign in to comment.