Sentry handshake fix (?) and not overwriting statusData with zero block (#2355)

* Not overwrite statusData from txpool status

* Report error when doing sentry handshake

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro.local>
This commit is contained in:
ledgerwatch 2021-07-13 10:33:04 +01:00 committed by GitHub
parent 75ee5db06f
commit 336515124b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -229,6 +229,7 @@ func SentryHandshake(ctx context.Context, sentry remote.SentryClient, controlSer
if s, ok := status.FromError(err); ok && s.Code() == codes.Canceled {
return nil
}
return err
}
return nil
}

View File

@ -846,7 +846,10 @@ func (ss *SentryServerImpl) SetStatus(_ context.Context, statusData *proto_sentr
}
}
ss.P2pServer.LocalNode().Set(eth.CurrentENREntryFromForks(statusData.ForkData.Forks, genesisHash, statusData.MaxBlock))
ss.statusData = statusData
if ss.statusData == nil || statusData.MaxBlock != 0 {
// Not overwrite statusData if the message contains zero MaxBlock (comes from standalone transaction pool)
ss.statusData = statusData
}
return reply, nil
}