aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv5
diff options
context:
space:
mode:
authorBas van Kervel <basvankervel@gmail.com>2017-06-21 16:24:34 +0800
committerBas van Kervel <basvankervel@gmail.com>2017-06-21 16:24:34 +0800
commitb6b0e0019810dd5fad992891c5db051b8603292d (patch)
tree592d4afe1e472b8732b167506ef01a9943076b9a /whisper/whisperv5
parent3d66ba56ef34e2b6a3a10c254506d8686adfff39 (diff)
downloaddexon-b6b0e0019810dd5fad992891c5db051b8603292d.tar
dexon-b6b0e0019810dd5fad992891c5db051b8603292d.tar.gz
dexon-b6b0e0019810dd5fad992891c5db051b8603292d.tar.bz2
dexon-b6b0e0019810dd5fad992891c5db051b8603292d.tar.lz
dexon-b6b0e0019810dd5fad992891c5db051b8603292d.tar.xz
dexon-b6b0e0019810dd5fad992891c5db051b8603292d.tar.zst
dexon-b6b0e0019810dd5fad992891c5db051b8603292d.zip
whisper: fallback to default config if none is specified
Diffstat (limited to 'whisper/whisperv5')
-rw-r--r--whisper/whisperv5/whisper.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/whisper/whisperv5/whisper.go b/whisper/whisperv5/whisper.go
index cc6c65a9f..83a408dfc 100644
--- a/whisper/whisperv5/whisper.go
+++ b/whisper/whisperv5/whisper.go
@@ -109,6 +109,10 @@ type Whisper struct {
// New creates a Whisper client ready to communicate through the Ethereum P2P network.
func New(cfg *Config) *Whisper {
+ if cfg == nil {
+ cfg = &DefaultConfig
+ }
+
whisper := &Whisper{
privateKeys: make(map[string]*ecdsa.PrivateKey),
symKeys: make(map[string][]byte),