From 2b5d535208b5a2364bc66fca5b960c4caf30ee9d Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Mon, 30 May 2022 19:14:54 +0800 Subject: [PATCH] channeldb: fix data race in TestSerializeRevocationLog When testing serializing revocation log, we need to also copy its `HTLCEntries` as the serialization of the HTLC involves a writing to the `htlc.amtTlv` field. --- channeldb/revocation_log_test.go | 1 + docs/release-notes/release-notes-0.15.0.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/channeldb/revocation_log_test.go b/channeldb/revocation_log_test.go index 1b17c9b28..35866c3cf 100644 --- a/channeldb/revocation_log_test.go +++ b/channeldb/revocation_log_test.go @@ -213,6 +213,7 @@ func TestSerializeRevocationLog(t *testing.T) { // Copy the testRevocationLog. rl := testRevocationLog + rl.HTLCEntries = []*HTLCEntry{&testHTLCEntry} // Write the tlv stream. buf := bytes.NewBuffer([]byte{}) diff --git a/docs/release-notes/release-notes-0.15.0.md b/docs/release-notes/release-notes-0.15.0.md index cae2f7f8c..c05eda2a8 100644 --- a/docs/release-notes/release-notes-0.15.0.md +++ b/docs/release-notes/release-notes-0.15.0.md @@ -283,6 +283,9 @@ from occurring that would result in an erroneous force close.](https://github.co * [Minor fix](https://github.com/lightningnetwork/lnd/pull/6535) to how bitcoind.rpccookie and bitocind.config are parsed from config file. +* [Fix a data race found when running unit test for revocation log](https://github.com/lightningnetwork/lnd/pull/6594). + + ## RPC Server * [Add value to the field