diff --git a/svc.go b/svc.go index 7cc02e7..2b368ae 100644 --- a/svc.go +++ b/svc.go @@ -36,9 +36,14 @@ func NewRendezvousService(ctx context.Context, host host.Host, dbpath string, rz return nil, err } + rz := NewRendezvousServiceWithDB(host, db, rzs...) + return rz, nil +} + +func NewRendezvousServiceWithDB(host host.Host, db *DB, rzs ...RendezvousSync) *RendezvousService { rz := &RendezvousService{DB: db, rzs: rzs} host.SetStreamHandler(RendezvousProto, rz.handleStream) - return rz, nil + return rz } func (rz *RendezvousService) handleStream(s inet.Stream) {