Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit 3c539c1

Browse files
Ruteriavalonche
authored andcommitted
miner: safely close payload when resolving best of many payloads
1 parent f1b5e62 commit 3c539c1

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

miner/payload_building.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,13 @@ func (payload *Payload) resolveBestFullPayload(payloads []*Payload) {
142142
}
143143
}
144144

145-
close(payload.stop)
145+
// Since we are not expecting any updates, close the payload already
146+
select {
147+
case <-payload.stop:
148+
default:
149+
close(payload.stop)
150+
}
151+
146152
payload.cond.Broadcast() // fire signal for notifying full block
147153

148154
if payload.full != nil {

0 commit comments

Comments
 (0)