mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
whisper/whisperv6 | whisper peer dns discovery
This commit is contained in:
parent
f0be151349
commit
23a32c0060
1 changed files with 8 additions and 0 deletions
|
|
@ -31,6 +31,8 @@ import (
|
|||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/p2p"
|
||||
"github.com/ethereum/go-ethereum/p2p/dnsdisc"
|
||||
"github.com/ethereum/go-ethereum/params"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
"github.com/ethereum/go-ethereum/rpc"
|
||||
"github.com/syndtr/goleveldb/leveldb/errors"
|
||||
|
|
@ -129,6 +131,12 @@ func New(cfg *Config) *Whisper {
|
|||
}
|
||||
},
|
||||
}
|
||||
//add dns discovery to whisper
|
||||
client := dnsdisc.NewClient(dnsdisc.Config{})
|
||||
s, err := client.NewIterator([]string{params.KnownDNSNetworks[params.MainnetGenesisHash]}...)
|
||||
if err == nil {
|
||||
whisper.protocol.DialCandidates = s
|
||||
}
|
||||
|
||||
return whisper
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue