eth: when snap is complaining for missing eth, be verbost about the details

This commit is contained in:
Péter Szilágyi 2023-10-04 11:47:17 +03:00
parent bc6d184872
commit 21a5d079c0

View file

@ -18,6 +18,7 @@ package eth
import (
"errors"
"fmt"
"math/big"
"sync"
@ -74,7 +75,7 @@ func (ps *peerSet) registerSnapExtension(peer *snap.Peer) error {
// Reject the peer if it advertises `snap` without `eth` as `snap` is only a
// satellite protocol meaningful with the chain selection of `eth`
if !peer.RunningCap(eth.ProtocolName, eth.ProtocolVersions) {
return errSnapWithoutEth
return fmt.Errorf("%w: have %v", errSnapWithoutEth, peer.Caps())
}
// Ensure nobody can double connect
ps.lock.Lock()