contractcourt: fix concurrent access to resolved

This commit makes `resolved` an atomic bool to avoid data race. This
field is now defined in `contractResolverKit` to avoid code duplication.
This commit is contained in:
yyforyongyu committed 2024-12-20 17:54:06 +08:00
1 parent 47722292c5
commit 4f5ccb8650
11 files changed
+111 -129

No files matched your search

+1 -1
View File
@@ -532,7 +532,7 @@ func testHtlcTimeoutResolver(t *testing.T, testCase htlcTimeoutTestCase) {
wg.Wait()
// Finally, the resolver should be marked as resolved.
if !resolver.resolved {
if !resolver.resolved.Load() {
t.Fatalf("resolver should be marked as resolved")
}
}