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

This fixes a bug in TransactionSender where it would return the
zero address for transactions where the sender address wasn't
cached already.

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
Lee Bousfield
2021-11-17 07:44:41 -06:00
committed by GitHub
parent fa96718512
commit 16341e0563
3 changed files with 124 additions and 41 deletions

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