whisper: final refactoring (#16259)

whisper: final refactoring
This commit is contained in:
gluk256
2018-03-06 23:37:43 +01:00
committed by Guillaume Ballet
parent 746392cfd2
commit f1d440a437
2 changed files with 60 additions and 31 deletions

View File

@@ -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]
}