diff options
author | gluk256 <gluk256@users.noreply.github.com> | 2018-03-07 06:37:43 +0800 |
---|---|---|
committer | Guillaume Ballet <gballet@gmail.com> | 2018-03-07 06:37:43 +0800 |
commit | f1d440a437908320452a077b443f03a6c9606dc0 (patch) | |
tree | fc12f439aa4664d4b00a642a5353697cb4817e6a /whisper | |
parent | 746392cfd26ddb29990c9f0490bb7bb7adce659c (diff) | |
download | dexon-f1d440a437908320452a077b443f03a6c9606dc0.tar dexon-f1d440a437908320452a077b443f03a6c9606dc0.tar.gz dexon-f1d440a437908320452a077b443f03a6c9606dc0.tar.bz2 dexon-f1d440a437908320452a077b443f03a6c9606dc0.tar.lz dexon-f1d440a437908320452a077b443f03a6c9606dc0.tar.xz dexon-f1d440a437908320452a077b443f03a6c9606dc0.tar.zst dexon-f1d440a437908320452a077b443f03a6c9606dc0.zip |
whisper: final refactoring (#16259)
whisper: final refactoring
Diffstat (limited to 'whisper')
-rw-r--r-- | whisper/whisperv6/envelope.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/whisper/whisperv6/envelope.go b/whisper/whisperv6/envelope.go index 2f947f1a4..c42d1fa8a 100644 --- a/whisper/whisperv6/envelope.go +++ b/whisper/whisperv6/envelope.go @@ -269,3 +269,11 @@ func TopicToBloom(topic TopicType) []byte { } return b } + +// GetEnvelope retrieves an envelope from the message queue by its hash. +// It returns nil if the envelope can not be found. +func (w *Whisper) GetEnvelope(hash common.Hash) *Envelope { + w.poolMu.RLock() + defer w.poolMu.RUnlock() + return w.envelopes[hash] +} |