mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
whisper: moved the check, changed the default PoW
This commit is contained in:
parent
1ea86735a8
commit
295bab223d
3 changed files with 4 additions and 6 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue