Add endpoint to fetch pubkey & Require wallet already unlocked when starting the service (#43)

* Add endpoint to fetch pubkey & simplify ports.Wallet

* Lint
This commit is contained in:
Pietralberto Mazza
2023-12-05 17:45:38 +01:00
committed by GitHub
parent 376d62f44b
commit 7bcdff0d2a
14 changed files with 425 additions and 563 deletions

View File

@@ -176,6 +176,17 @@ func (h *handler) ListVtxos(ctx context.Context, req *arkv1.ListVtxosRequest) (*
}, nil
}
func (h *handler) GetPubkey(ctx context.Context, req *arkv1.GetPubkeyRequest) (*arkv1.GetPubkeyResponse, error) {
pubkey, err := h.svc.GetPubkey(ctx)
if err != nil {
return nil, err
}
return &arkv1.GetPubkeyResponse{
Pubkey: pubkey,
}, nil
}
func (h *handler) pushListener(l *listener) {
h.listenersLock.Lock()
defer h.listenersLock.Unlock()