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

@@ -730,13 +730,13 @@ func (h *htlcSuccessResolver) resolveSuccessTxOutput(op wire.OutPoint) error {
// Launch creates an input based on the details of the incoming htlc resolution
// and offers it to the sweeper.
func (h *htlcSuccessResolver) 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.