diff --git a/p2p/peer/peer_table.go b/p2p/peer/peer_table.go index 8d4c31b7..1d082b7f 100644 --- a/p2p/peer/peer_table.go +++ b/p2p/peer/peer_table.go @@ -283,5 +283,7 @@ func (pt *PeerTable) persistPeers() { } func (pt *PeerTable) writeToDB(key, value string) { - pt.db.Put([]byte(key), []byte(value), nil) + if pt.db != nil { + pt.db.Put([]byte(key), []byte(value), nil) + } }