ethclient: fix tx sender cache miss detection #23877 (#1366)

This commit is contained in:
Daniel Liu 2025-08-21 13:43:52 +08:00 committed by GitHub
parent 992e931623
commit b96310ebe7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -246,6 +246,8 @@ func (ec *Client) TransactionSender(ctx context.Context, tx *types.Transaction,
if err == nil {
return sender, nil
}
// It was not found in cache, ask the server.
var meta struct {
Hash common.Hash
From common.Address

View file

@ -45,7 +45,7 @@ func (s *senderFromServer) Equal(other types.Signer) bool {
}
func (s *senderFromServer) Sender(tx *types.Transaction) (common.Address, error) {
if s.blockhash == (common.Hash{}) {
if s.addr == (common.Address{}) {
return common.Address{}, errNotCached
}
return s.addr, nil