whisper: moved the check, changed the default PoW

This commit is contained in:
Vlad 2016-12-12 11:22:54 +01:00
parent 1ea86735a8
commit 295bab223d
3 changed files with 4 additions and 6 deletions

View file

@ -56,7 +56,7 @@ const (
AESNonceMaxLength = 12 AESNonceMaxLength = 12
MaxMessageLength = 0xFFFF // todo: remove this restriction after testing. this should be regulated by PoW. MaxMessageLength = 0xFFFF // todo: remove this restriction after testing. this should be regulated by PoW.
MinimumPoW = 10.0 // todo: review after testing. MinimumPoW = 1.0 // todo: review after testing.
padSizeLimitLower = 128 // it can not be less - we don't want to reveal the absence of signature padSizeLimitLower = 128 // it can not be less - we don't want to reveal the absence of signature
padSizeLimitUpper = 256 // just an arbitrary number, could be changed without losing compatibility padSizeLimitUpper = 256 // just an arbitrary number, could be changed without losing compatibility

View file

@ -77,10 +77,6 @@ func (fs *Filters) Get(i uint32) *Filter {
} }
func (fs *Filters) NotifyWatchers(env *Envelope, messageCode uint64) { func (fs *Filters) NotifyWatchers(env *Envelope, messageCode uint64) {
if env == nil {
return
}
fs.mutex.RLock() fs.mutex.RLock()
var msg *ReceivedMessage var msg *ReceivedMessage
for j, watcher := range fs.watchers { for j, watcher := range fs.watchers {

View file

@ -500,9 +500,11 @@ func (w *Whisper) processQueue() {
w.poolMu.Lock() w.poolMu.Lock()
e := w.envelopes[i.hash] e := w.envelopes[i.hash]
w.poolMu.Unlock() w.poolMu.Unlock()
if e != nil {
w.filters.NotifyWatchers(e, i.code) w.filters.NotifyWatchers(e, i.code)
} }
} }
}
} }
// update loops until the lifetime of the whisper node, updating its internal // update loops until the lifetime of the whisper node, updating its internal