Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion consensus/bor/bor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ func (c *Bor) CommitStates(
processStart := time.Now()
totalGas := 0 /// limit on gas for state sync per block
chainID := c.chainConfig.ChainID.String()
stateSyncs := make([]*types.StateSyncData, len(eventRecords))
stateSyncs := make([]*types.StateSyncData, 0, len(eventRecords))

var gasUsed uint64

Expand Down
4 changes: 2 additions & 2 deletions eth/filters/bor_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ func (api *PublicFilterAPI) NewDeposits(ctx context.Context, crit ethereum.State
for {
select {
case h := <-stateSyncData:
if crit.ID == h.ID || bytes.Compare(crit.Contract.Bytes(), h.Contract.Bytes()) == 0 ||
(crit.ID == 0 && crit.Contract == common.Address{}) {
if h != nil && (crit.ID == h.ID || bytes.Equal(crit.Contract.Bytes(), h.Contract.Bytes()) ||
Comment thread
manav2401 marked this conversation as resolved.
Outdated
(crit.ID == 0 && crit.Contract == common.Address{})) {
notifier.Notify(rpcSub.ID, h)
}
case <-rpcSub.Err():
Expand Down