whisper: expiry refactoring (#3706)

This commit is contained in:
gluk256
2017-02-23 18:46:32 +01:00
committed by Felix Lange
parent 357732a840
commit 11539030cd
5 changed files with 72 additions and 36 deletions

View File

@ -64,6 +64,14 @@ func (api *PublicWhisperAPI) Version() (hexutil.Uint, error) {
return hexutil.Uint(api.whisper.Version()), nil
}
// Stats returns the Whisper statistics for diagnostics.
func (api *PublicWhisperAPI) Stats() (string, error) {
if api.whisper == nil {
return "", whisperOffLineErr
}
return api.whisper.Stats(), nil
}
// MarkPeerTrusted marks specific peer trusted, which will allow it
// to send historic (expired) messages.
func (api *PublicWhisperAPI) MarkPeerTrusted(peerID hexutil.Bytes) error {