Skip to content

Commit

Permalink
Refactor to use thread-safe maps
Browse files Browse the repository at this point in the history
  • Loading branch information
Impa10r committed Dec 23, 2024
1 parent b56fcbe commit fd20619
Show file tree
Hide file tree
Showing 9 changed files with 251 additions and 146 deletions.
6 changes: 3 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"buildFlags": "-tags lnd",
"program": "${workspaceFolder}/cmd/psweb/",
"showLog": false,
"envFile": "${workspaceFolder}/.env",
//"args": ["-datadir", "/home/vlad/.peerswap_t4"]
"args": ["-datadir", "/home/vlad/.peerswap2"]
//"envFile": "${workspaceFolder}/.env",
"args": ["-datadir", "/home/vlad/.peerswap_t4"]
//"args": ["-datadir", "/home/vlad/.peerswap2"]
},
// sudo bash -c 'echo 0 > /proc/sys/kernel/yama/ptrace_scope'
// go install -tags cln -gcflags 'all=-N -l' ./cmd/psweb
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Versions

## 1.7.5

- CLN: allow -developer flag
- Refactor to use thread-safe maps

## 1.7.4

- Bump Go version to v1.22.2
Expand Down
2 changes: 1 addition & 1 deletion cmd/psweb/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1171,7 +1171,7 @@ func afHandler(w http.ResponseWriter, r *http.Request) {
}

daysNoFlow := 999
ts, ok := ln.LastForwardTS[ch.ChannelId]
ts, ok := ln.LastForwardTS.SafeRead(ch.ChannelId)
if ok {
daysNoFlow = int(currentTime.Sub(time.Unix(ts, 0)).Hours() / 24)
}
Expand Down
Loading

0 comments on commit fd20619

Please sign in to comment.