channeldb: fix data race in TestSerializeHTLCEntries

This commit is contained in:
yyforyongyu
2022-06-27 19:47:54 +08:00
parent 0df880139f
commit 0e12a91715
2 changed files with 9 additions and 2 deletions

View File

@@ -211,9 +211,10 @@ func TestSerializeHTLCEntries(t *testing.T) {
func TestSerializeRevocationLog(t *testing.T) {
t.Parallel()
// Copy the testRevocationLog.
// Copy the testRevocationLog and testHTLCEntry.
rl := testRevocationLog
rl.HTLCEntries = []*HTLCEntry{&testHTLCEntry}
htlc := testHTLCEntry
rl.HTLCEntries = []*HTLCEntry{&htlc}
// Write the tlv stream.
buf := bytes.NewBuffer([]byte{})