From f1d440a437908320452a077b443f03a6c9606dc0 Mon Sep 17 00:00:00 2001 From: gluk256 Date: Tue, 6 Mar 2018 23:37:43 +0100 Subject: whisper: final refactoring (#16259) whisper: final refactoring --- whisper/whisperv6/envelope.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'whisper') 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] +} -- cgit v1.2.3