Merge pull request #9984 from starius/lntest-feeservice-mutex

lntest: do not do IO under mutex in fee_service
This commit is contained in:
Oliver Gugger authored and GitHub committed 2025-06-24 14:09:10 +02:00
commit a9b530ce4a
1 file changed
+1 -2
+1 -2
View File
@@ -115,14 +115,13 @@ func (f *FeeService) Start() error {
// handleRequest handles a client request for fee estimates.
func (f *FeeService) handleRequest(w http.ResponseWriter, _ *http.Request) {
f.lock.Lock()
defer f.lock.Unlock()
bytes, err := json.Marshal(
chainfee.WebAPIResponse{
FeeByBlockTarget: f.feeRateMap,
MinRelayFeerate: f.minRelayFeerate,
},
)
f.lock.Unlock()
require.NoErrorf(f, err, "cannot serialize estimates")
_, err = io.WriteString(w, string(bytes))