funding: failure logs print `<nil>` error and zero channel ID

Aperta Adatta ai principianti
#11,676 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@litbot-9000 ci sta già lavorando.

Dal 2/12/2026.

  • #11678 di @litbot-9000 — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
90/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go
Ambito
backend

Direzione di ricerca

Inizia in funding/manager.go ed esamina sendChannelReady, fundeeProcessFundingCreated e waitForFundingWithTimeout alle righe collegate. Correggi l'ambito della variabile di errore, usa l'ID del canale disponibile prima che venga copiato in cid.chanID e ripristina lo spazio mancante nel messaggio di errore della conferma di finanziamento. Fatto significa che le tre output di log/errore contengono i valori di errore e ID del canale previsti senza modificare il comportamento circostante.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A few small logging issues.

1. sendChannelReady logs <nil> instead of the send error

https://github.com/lightningnetwork/lnd/blob/d5651c62990282fae6930e9e926b463bb74aaee0/funding/manager.go#L3788-L3795

The err from SendMessage is scoped to the if, so the warning prints the err from waitForPeerOnline, which is always nil there:

[WRN] FNDG: Unable to send channelReady to peer 034f355b...: <nil>. Will retry when online

2. fundeeProcessFundingCreated logs a zero channel ID

cid.chanID is only set after the error is logged:

https://github.com/lightningnetwork/lnd/blob/d5651c62990282fae6930e9e926b463bb74aaee0/funding/manager.go#L2805-L2814

[ERR] FNDG: Unable to add pending channel 0000000000000000000000000000000000000000000000000000000000000000 with peer 034f355b...: peer exiting

3. Missing space

fundingconfirmation in waitForFundingWithTimeout:

https://github.com/lightningnetwork/lnd/blob/d5651c62990282fae6930e9e926b463bb74aaee0/funding/manager.go#L3228-L3229

Suggested fix

--- a/funding/manager.go
+++ b/funding/manager.go
@@ -2805,7 +2805,7 @@ func (f *Manager) fundeeProcessFundingCreated(peer lnpeer.Peer,
 	if err := peer.AddPendingChannel(channelID, f.quit); err != nil {
 		pubKey := peer.IdentityKey().SerializeCompressed()
 		log.Errorf("Unable to add pending channel %v with peer %x: %v",
-			cid.chanID, pubKey, err)
+			channelID, pubKey, err)
 	}
 
 	// Once Brontide is aware of this channel, we need to set it in
@@ -3225,7 +3225,7 @@ func (f *Manager) waitForFundingWithTimeout(
 
 	case confirmedChannel, ok := <-confChan:
 		if !ok {
-			return nil, fmt.Errorf("waiting for funding" +
+			return nil, fmt.Errorf("waiting for funding " +
 				"confirmation failed")
 		}
 		return confirmedChannel, nil
@@ -3785,7 +3785,8 @@ func (f *Manager) sendChannelReady(completeChan *chanstate.OpenChannel,
 		log.Infof("Peer(%x) is online, sending ChannelReady "+
 			"for ChannelID(%v)", peerKey, chanID)
 
-		if err := peer.SendMessage(true, channelReadyMsg); err == nil {
+		err = peer.SendMessage(true, channelReadyMsg)
+		if err == nil {
 			// Sending succeeded, we can break out and continue the
 			// funding flow.
 			break

Discovery

Both log lines were triggered by smite, while the peer was disconnecting. The missing space was found during subsequent source analysis.

Lingua principale
Go
Stelle
8.2k
Fork
2.3k
Merge medio
1g 11h
PR unite (30g)
103

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lightningnetwork/lnd

Tutte le issue di lightningnetwork/lnd

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.