Fix nil pointer dereference when subscribing to pending txs (#1823)

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
This commit is contained in:
ledgerwatch 2021-04-26 18:38:20 +01:00 committed by GitHub
parent 57c88868a3
commit 6b84a92b7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,12 @@ type Filters struct {
func New(ethBackend core.ApiBackend) *Filters {
log.Info("rpc filters: subscribing to tg events")
ff := &Filters{headsSubs: make(map[HeadsSubID]chan *types.Header), pendingLogsSubs: make(map[PendingLogsSubID]chan types.Logs), pendingBlockSubs: make(map[PendingBlockSubID]chan *types.Block)}
ff := &Filters{
headsSubs: make(map[HeadsSubID]chan *types.Header),
pendingLogsSubs: make(map[PendingLogsSubID]chan types.Logs),
pendingBlockSubs: make(map[PendingBlockSubID]chan *types.Block),
pendingTxsSubs: make(map[PendingTxsSubID]chan []types.Transaction),
}
go func() {
var err error