mirror of
https://github.com/status-im/status-go.git
synced 2025-02-16 16:56:53 +00:00
patch sending message without subscription applied
This commit is contained in:
parent
aaf2b41e2e
commit
de0c03ca4e
1
vendor/github.com/ethereum/go-ethereum/whisper/whisperv6/api.go
generated
vendored
1
vendor/github.com/ethereum/go-ethereum/whisper/whisperv6/api.go
generated
vendored
@ -264,6 +264,7 @@ func (api *PublicWhisperAPI) Post(ctx context.Context, req NewMessage) (bool, er
|
||||
WorkTime: req.PowTime,
|
||||
PoW: req.PowTarget,
|
||||
Topic: req.Topic,
|
||||
self: true,
|
||||
}
|
||||
|
||||
// Set key that is used to sign the message
|
||||
|
1
vendor/github.com/ethereum/go-ethereum/whisper/whisperv6/envelope.go
generated
vendored
1
vendor/github.com/ethereum/go-ethereum/whisper/whisperv6/envelope.go
generated
vendored
@ -47,6 +47,7 @@ type Envelope struct {
|
||||
// the following variables should not be accessed directly, use the corresponding function instead: Hash(), Bloom()
|
||||
hash common.Hash // Cached hash of the envelope to avoid rehashing every time.
|
||||
bloom []byte
|
||||
self bool
|
||||
}
|
||||
|
||||
// size returns the size of envelope as it is sent (i.e. public fields only)
|
||||
|
3
vendor/github.com/ethereum/go-ethereum/whisper/whisperv6/message.go
generated
vendored
3
vendor/github.com/ethereum/go-ethereum/whisper/whisperv6/message.go
generated
vendored
@ -46,6 +46,8 @@ type MessageParams struct {
|
||||
PoW float64
|
||||
Payload []byte
|
||||
Padding []byte
|
||||
|
||||
self bool
|
||||
}
|
||||
|
||||
// SentMessage represents an end-user data packet to transmit through the
|
||||
@ -258,6 +260,7 @@ func (msg *sentMessage) Wrap(options *MessageParams) (envelope *Envelope, err er
|
||||
if err = envelope.Seal(options); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
envelope.self = options.self
|
||||
return envelope, nil
|
||||
}
|
||||
|
||||
|
2
vendor/github.com/ethereum/go-ethereum/whisper/whisperv6/whisper.go
generated
vendored
2
vendor/github.com/ethereum/go-ethereum/whisper/whisperv6/whisper.go
generated
vendored
@ -852,7 +852,7 @@ func (whisper *Whisper) add(envelope *Envelope) (bool, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if !bloomFilterMatch(whisper.BloomFilter(), envelope.Bloom()) {
|
||||
if !envelope.self && !bloomFilterMatch(whisper.BloomFilter(), envelope.Bloom()) {
|
||||
// maybe the value was recently changed, and the peers did not adjust yet.
|
||||
// in this case the previous value is retrieved by BloomFilterTolerance()
|
||||
// for a short period of peer synchronization.
|
||||
|
Loading…
x
Reference in New Issue
Block a user