contractcourt: fix concurrent access to launched

This commit is contained in:
yyforyongyu
2024-07-11 16:19:01 +08:00
parent 4f5ccb8650
commit d2e81a19fd
8 changed files with 27 additions and 14 deletions

View File

@@ -1270,13 +1270,13 @@ func (h *htlcTimeoutResolver) resolveTimeoutTxOutput(op wire.OutPoint) error {
// Launch creates an input based on the details of the outgoing htlc resolution
// and offers it to the sweeper.
func (h *htlcTimeoutResolver) Launch() error {
if h.launched {
if h.isLaunched() {
h.log.Tracef("already launched")
return nil
}
h.log.Debugf("launching resolver...")
h.launched = true
h.markLaunched()
switch {
// If we're already resolved, then we can exit early.