mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
whisper: remove some warnings
This commit is contained in:
parent
ad1156653b
commit
b2b4f8c772
4 changed files with 9 additions and 8 deletions
|
|
@ -18,10 +18,11 @@ package whisperv6
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"github.com/ethereum/go-ethereum/p2p"
|
||||
set "gopkg.in/fatih/set.v0"
|
||||
"time"
|
||||
)
|
||||
|
||||
// DevP2PPeer is the DevP2P implementation of the Peer interface
|
||||
|
|
|
|||
|
|
@ -21,11 +21,12 @@ import (
|
|||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
"io"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/log"
|
||||
|
||||
"github.com/ethereum/go-ethereum/p2p"
|
||||
"github.com/ethereum/go-ethereum/rlp"
|
||||
crypto "github.com/libp2p/go-libp2p-crypto"
|
||||
|
|
@ -197,11 +198,12 @@ updateLoop:
|
|||
|
||||
// LibP2PWhisperServer implements WhisperServer for libp2p.
|
||||
type LibP2PWhisperServer struct {
|
||||
Host host.Host
|
||||
Host host.Host // Libp2p host structure
|
||||
|
||||
PeerMutex sync.RWMutex // Guard the list of active peers
|
||||
Peers []*LibP2PPeer // List of active peers
|
||||
|
||||
whisper *Whisper
|
||||
whisper *Whisper // Pointer to the whisper object
|
||||
}
|
||||
|
||||
func (server *LibP2PWhisperServer) connectToPeer(p *LibP2PPeer) error {
|
||||
|
|
|
|||
|
|
@ -221,6 +221,7 @@ func (peer *PeerBase) stream() p2p.MsgReadWriter {
|
|||
return peer.ws
|
||||
}
|
||||
|
||||
// MakeFullNodeBloom returns a bloom filter that accepts all topics
|
||||
func MakeFullNodeBloom() []byte {
|
||||
bloom := make([]byte, BloomFilterSize)
|
||||
for i := 0; i < BloomFilterSize; i++ {
|
||||
|
|
|
|||
|
|
@ -99,10 +99,6 @@ type Whisper struct {
|
|||
mailServer MailServer // MailServer interface
|
||||
}
|
||||
|
||||
type DevP2PBridge struct {
|
||||
*Whisper
|
||||
}
|
||||
|
||||
// New creates a Whisper client ready to communicate through the Ethereum P2P network.
|
||||
func New(cfg *Config) *Whisper {
|
||||
if cfg == nil {
|
||||
|
|
@ -1045,6 +1041,7 @@ func isFullNode(bloom []byte) bool {
|
|||
return true
|
||||
}
|
||||
|
||||
// BloomFilterMatch checks if a bloom filter is a superset of a series of bytes
|
||||
func BloomFilterMatch(filter, sample []byte) bool {
|
||||
if filter == nil {
|
||||
return true
|
||||
|
|
|
|||
Loading…
Reference in a new issue