From 246c05fcd870a2779eb090a72118e2abd50aadd8 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 31 Jan 2018 14:00:01 -0800 Subject: [PATCH] lnwallet: add additional debug logging for txns during funding flows --- lnwallet/wallet.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lnwallet/wallet.go b/lnwallet/wallet.go index e96e20a6..6d3bac07 100644 --- a/lnwallet/wallet.go +++ b/lnwallet/wallet.go @@ -807,6 +807,9 @@ func (l *LightningWallet) handleContributionMsg(req *addContributionMsg) { fundingOutpoint := wire.NewOutPoint(&fundingTxID, multiSigIndex) pendingReservation.partialState.FundingOutpoint = *fundingOutpoint + walletLog.Debugf("Funding tx for ChannelPoint(%v) generated: %v", + fundingOutpoint, spew.Sdump(fundingTx)) + // Initialize an empty sha-chain for them, tracking the current pending // revocation hash (we don't yet know the preimage so we can't add it // to the chain). @@ -879,6 +882,11 @@ func (l *LightningWallet) handleContributionMsg(req *addContributionMsg) { txsort.InPlaceSort(ourCommitTx) txsort.InPlaceSort(theirCommitTx) + walletLog.Debugf("Local commit tx for ChannelPoint(%v): %v", + fundingOutpoint, spew.Sdump(ourCommitTx)) + walletLog.Debugf("Remote commit tx for ChannelPoint(%v): %v", + fundingOutpoint, spew.Sdump(theirCommitTx)) + // Record newly available information within the open channel state. chanState.FundingOutpoint = *fundingOutpoint chanState.LocalCommitment.CommitTx = ourCommitTx @@ -1181,6 +1189,11 @@ func (l *LightningWallet) handleSingleFunderSigs(req *addSingleFunderSigsMsg) { chanState.LocalCommitment.CommitTx = ourCommitTx chanState.RemoteCommitment.CommitTx = theirCommitTx + walletLog.Debugf("Local commit tx for ChannelPoint(%v): %v", + req.fundingOutpoint, spew.Sdump(ourCommitTx)) + walletLog.Debugf("Remote commit tx for ChannelPoint(%v): %v", + req.fundingOutpoint, spew.Sdump(theirCommitTx)) + channelValue := int64(pendingReservation.partialState.Capacity) hashCache := txscript.NewTxSigHashes(ourCommitTx) theirKey := pendingReservation.theirContribution.MultiSigKey