aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv5/whisper.go
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/whisper.go
parent3d66ba56ef34e2b6a3a10c254506d8686adfff39 (diff)
downloadgo-tangerine-b6b0e0019810dd5fad992891c5db051b8603292d.tar
go-tangerine-b6b0e0019810dd5fad992891c5db051b8603292d.tar.gz
go-tangerine-b6b0e0019810dd5fad992891c5db051b8603292d.tar.bz2
go-tangerine-b6b0e0019810dd5fad992891c5db051b8603292d.tar.lz
go-tangerine-b6b0e0019810dd5fad992891c5db051b8603292d.tar.xz
go-tangerine-b6b0e0019810dd5fad992891c5db051b8603292d.tar.zst
go-tangerine-b6b0e0019810dd5fad992891c5db051b8603292d.zip
whisper: fallback to default config if none is specified
Diffstat (limited to 'whisper/whisperv5/whisper.go')
-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),