aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisperv5/filter.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-02-22 20:10:07 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-02-23 18:16:44 +0800
commitd4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851 (patch)
tree17c93170551d3eeabe2935de1765f157007f0dc2 /whisper/whisperv5/filter.go
parent47af53f9aaf9aa7b12cd976eb150ccf3d64da6fd (diff)
downloaddexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar
dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.gz
dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.bz2
dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.lz
dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.xz
dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.tar.zst
dexon-d4fd06c3dc6cd6d2dbd2bfebfee5bcb46a504851.zip
all: blidly swap out glog to our log15, logs need rework
Diffstat (limited to 'whisper/whisperv5/filter.go')
-rw-r--r--whisper/whisperv5/filter.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/whisper/whisperv5/filter.go b/whisper/whisperv5/filter.go
index 832ebe3f6..8aa7b2429 100644
--- a/whisper/whisperv5/filter.go
+++ b/whisper/whisperv5/filter.go
@@ -18,13 +18,12 @@ package whisperv5
import (
"crypto/ecdsa"
- crand "crypto/rand"
+ "crypto/rand"
"fmt"
"sync"
"github.com/ethereum/go-ethereum/common"
- "github.com/ethereum/go-ethereum/logger"
- "github.com/ethereum/go-ethereum/logger/glog"
+ "github.com/ethereum/go-ethereum/log"
)
type Filter struct {
@@ -56,7 +55,7 @@ func NewFilters(w *Whisper) *Filters {
func (fs *Filters) generateRandomID() (id string, err error) {
buf := make([]byte, 20)
for i := 0; i < 3; i++ {
- _, err = crand.Read(buf)
+ _, err = rand.Read(buf)
if err != nil {
continue
}
@@ -107,7 +106,7 @@ func (fs *Filters) NotifyWatchers(env *Envelope, p2pMessage bool) {
var msg *ReceivedMessage
for j, watcher := range fs.watchers {
if p2pMessage && !watcher.AcceptP2P {
- glog.V(logger.Detail).Infof("msg [%x], filter [%d]: p2p messages are not allowed \n", env.Hash(), j)
+ log.Trace(fmt.Sprintf("msg [%x], filter [%s]: p2p messages are not allowed", env.Hash(), j))
continue
}
@@ -119,10 +118,10 @@ func (fs *Filters) NotifyWatchers(env *Envelope, p2pMessage bool) {
if match {
msg = env.Open(watcher)
if msg == nil {
- glog.V(logger.Detail).Infof("msg [%x], filter [%d]: failed to open \n", env.Hash(), j)
+ log.Trace(fmt.Sprintf("msg [%x], filter [%s]: failed to open", env.Hash(), j))
}
} else {
- glog.V(logger.Detail).Infof("msg [%x], filter [%d]: does not match \n", env.Hash(), j)
+ log.Trace(fmt.Sprintf("msg [%x], filter [%s]: does not match", env.Hash(), j))
}
}