fundingmanager: print hex of pending chan id, use snake case

This commit is contained in:
Conner Fromknecht 2019-11-05 15:04:43 -08:00
parent 0035e8b99d
commit 52b3d5bbf7
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7

@ -678,7 +678,7 @@ func (f *fundingManager) CancelPeerReservations(nodePub [33]byte) {
func (f *fundingManager) failFundingFlow(peer lnpeer.Peer, tempChanID [32]byte, func (f *fundingManager) failFundingFlow(peer lnpeer.Peer, tempChanID [32]byte,
fundingErr error) { fundingErr error) {
fndgLog.Debugf("Failing funding flow for pendingID=%x: %v", fndgLog.Debugf("Failing funding flow for pending_id=%x: %v",
tempChanID, fundingErr) tempChanID, fundingErr)
ctx, err := f.cancelReservationCtx(peer.IdentityKey(), tempChanID) ctx, err := f.cancelReservationCtx(peer.IdentityKey(), tempChanID)
@ -812,7 +812,7 @@ func (f *fundingManager) advanceFundingState(channel *channeldb.OpenChannel,
// network. // network.
// TODO(halseth): could do graph consistency check // TODO(halseth): could do graph consistency check
// here, and re-add the edge if missing. // here, and re-add the edge if missing.
fndgLog.Debugf("ChannlPoint(%v) with chanID=%v not "+ fndgLog.Debugf("ChannelPoint(%v) with chan_id=%x not "+
"found in opening database, assuming already "+ "found in opening database, assuming already "+
"announced to the network", "announced to the network",
channel.FundingOutpoint, pendingChanID) channel.FundingOutpoint, pendingChanID)
@ -1330,7 +1330,7 @@ func (f *fundingManager) handleFundingOpen(fmsg *fundingOpenMsg) {
return return
} }
fndgLog.Infof("Sending fundingResp for pendingID(%x)", fndgLog.Infof("Sending fundingResp for pending_id(%x)",
msg.PendingChannelID) msg.PendingChannelID)
fndgLog.Debugf("Remote party accepted commitment constraints: %v", fndgLog.Debugf("Remote party accepted commitment constraints: %v",
spew.Sdump(remoteContribution.ChannelConfig.ChannelConstraints)) spew.Sdump(remoteContribution.ChannelConfig.ChannelConstraints))
@ -1383,7 +1383,7 @@ func (f *fundingManager) handleFundingAccept(fmsg *fundingAcceptMsg) {
resCtx, err := f.getReservationCtx(peerKey, pendingChanID) resCtx, err := f.getReservationCtx(peerKey, pendingChanID)
if err != nil { if err != nil {
fndgLog.Warnf("Can't find reservation (peerKey:%v, chanID:%v)", fndgLog.Warnf("Can't find reservation (peerKey:%v, chan_id:%v)",
peerKey, pendingChanID) peerKey, pendingChanID)
return return
} }
@ -1391,7 +1391,8 @@ func (f *fundingManager) handleFundingAccept(fmsg *fundingAcceptMsg) {
// Update the timestamp once the fundingAcceptMsg has been handled. // Update the timestamp once the fundingAcceptMsg has been handled.
defer resCtx.updateTimestamp() defer resCtx.updateTimestamp()
fndgLog.Infof("Recv'd fundingResponse for pendingID(%x)", pendingChanID[:]) fndgLog.Infof("Recv'd fundingResponse for pending_id(%x)",
pendingChanID[:])
// The required number of confirmations should not be greater than the // The required number of confirmations should not be greater than the
// maximum number of confirmations required by the ChainNotifier to // maximum number of confirmations required by the ChainNotifier to
@ -1500,7 +1501,7 @@ func (f *fundingManager) handleFundingAccept(fmsg *fundingAcceptMsg) {
f.signedReservations[channelID] = pendingChanID f.signedReservations[channelID] = pendingChanID
f.resMtx.Unlock() f.resMtx.Unlock()
fndgLog.Infof("Generated ChannelPoint(%v) for pendingID(%x)", outPoint, fndgLog.Infof("Generated ChannelPoint(%v) for pending_id(%x)", outPoint,
pendingChanID[:]) pendingChanID[:])
fundingCreated := &lnwire.FundingCreated{ fundingCreated := &lnwire.FundingCreated{
@ -1542,7 +1543,7 @@ func (f *fundingManager) handleFundingCreated(fmsg *fundingCreatedMsg) {
resCtx, err := f.getReservationCtx(peerKey, pendingChanID) resCtx, err := f.getReservationCtx(peerKey, pendingChanID)
if err != nil { if err != nil {
fndgLog.Warnf("can't find reservation (peerID:%v, chanID:%x)", fndgLog.Warnf("can't find reservation (peer_id:%v, chan_id:%x)",
peerKey, pendingChanID[:]) peerKey, pendingChanID[:])
return return
} }
@ -1553,7 +1554,7 @@ func (f *fundingManager) handleFundingCreated(fmsg *fundingCreatedMsg) {
// initiator's commitment transaction, then send our own if it's valid. // initiator's commitment transaction, then send our own if it's valid.
// TODO(roasbeef): make case (p vs P) consistent throughout // TODO(roasbeef): make case (p vs P) consistent throughout
fundingOut := fmsg.msg.FundingPoint fundingOut := fmsg.msg.FundingPoint
fndgLog.Infof("completing pendingID(%x) with ChannelPoint(%v)", fndgLog.Infof("completing pending_id(%x) with ChannelPoint(%v)",
pendingChanID[:], fundingOut) pendingChanID[:], fundingOut)
// With all the necessary data available, attempt to advance the // With all the necessary data available, attempt to advance the
@ -1608,7 +1609,7 @@ func (f *fundingManager) handleFundingCreated(fmsg *fundingCreatedMsg) {
f.newChanBarriers[channelID] = make(chan struct{}) f.newChanBarriers[channelID] = make(chan struct{})
f.barrierMtx.Unlock() f.barrierMtx.Unlock()
fndgLog.Infof("sending FundingSigned for pendingID(%x) over "+ fndgLog.Infof("sending FundingSigned for pending_id(%x) over "+
"ChannelPoint(%v)", pendingChanID[:], fundingOut) "ChannelPoint(%v)", pendingChanID[:], fundingOut)
// With their signature for our version of the commitment transaction // With their signature for our version of the commitment transaction
@ -1704,8 +1705,8 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) {
peerKey := fmsg.peer.IdentityKey() peerKey := fmsg.peer.IdentityKey()
resCtx, err := f.getReservationCtx(peerKey, pendingChanID) resCtx, err := f.getReservationCtx(peerKey, pendingChanID)
if err != nil { if err != nil {
fndgLog.Warnf("Unable to find reservation (peerID:%v, chanID:%x)", fndgLog.Warnf("Unable to find reservation (peer_id:%v, "+
peerKey, pendingChanID[:]) "chan_id:%x)", peerKey, pendingChanID[:])
// TODO: add ErrChanNotFound? // TODO: add ErrChanNotFound?
f.failFundingFlow(fmsg.peer, pendingChanID, err) f.failFundingFlow(fmsg.peer, pendingChanID, err)
return return
@ -1764,7 +1765,7 @@ func (f *fundingManager) handleFundingSigned(fmsg *fundingSignedMsg) {
"arbitration: %v", fundingPoint, err) "arbitration: %v", fundingPoint, err)
} }
fndgLog.Infof("Finalizing pendingID(%x) over ChannelPoint(%v), "+ fndgLog.Infof("Finalizing pending_id(%x) over ChannelPoint(%v), "+
"waiting for channel open on-chain", pendingChanID[:], "waiting for channel open on-chain", pendingChanID[:],
fundingPoint) fundingPoint)
@ -1936,7 +1937,7 @@ func (f *fundingManager) waitForFundingConfirmation(
} }
fundingPoint := completeChan.FundingOutpoint fundingPoint := completeChan.FundingOutpoint
fndgLog.Infof("ChannelPoint(%v) is now active: ChannelID(%x)", fndgLog.Infof("ChannelPoint(%v) is now active: ChannelID(%v)",
fundingPoint, lnwire.NewChanIDFromOutPoint(&fundingPoint)) fundingPoint, lnwire.NewChanIDFromOutPoint(&fundingPoint))
// With the block height and the transaction index known, we can // With the block height and the transaction index known, we can
@ -2818,7 +2819,7 @@ func (f *fundingManager) handleInitFundingMsg(msg *initFundingMsg) {
// reservation throughout its lifetime. // reservation throughout its lifetime.
chanID := f.nextPendingChanID() chanID := f.nextPendingChanID()
fndgLog.Infof("Target commit tx sat/kw for pendingID(%x): %v", chanID, fndgLog.Infof("Target commit tx sat/kw for pending_id(%x): %v", chanID,
int64(commitFeePerKw)) int64(commitFeePerKw))
// If the remote CSV delay was not set in the open channel request, // If the remote CSV delay was not set in the open channel request,
@ -2868,7 +2869,7 @@ func (f *fundingManager) handleInitFundingMsg(msg *initFundingMsg) {
maxValue := f.cfg.RequiredRemoteMaxValue(capacity) maxValue := f.cfg.RequiredRemoteMaxValue(capacity)
maxHtlcs := f.cfg.RequiredRemoteMaxHTLCs(capacity) maxHtlcs := f.cfg.RequiredRemoteMaxHTLCs(capacity)
fndgLog.Infof("Starting funding workflow with %v for pendingID(%x), "+ fndgLog.Infof("Starting funding workflow with %v for pending_id(%x), "+
"tweakless=%v", msg.peer.Address(), chanID, tweaklessCommitment) "tweakless=%v", msg.peer.Address(), chanID, tweaklessCommitment)
fundingOpen := lnwire.OpenChannel{ fundingOpen := lnwire.OpenChannel{
@ -2997,7 +2998,7 @@ func (f *fundingManager) pruneZombieReservations() {
for pendingChanID, resCtx := range zombieReservations { for pendingChanID, resCtx := range zombieReservations {
err := fmt.Errorf("reservation timed out waiting for peer "+ err := fmt.Errorf("reservation timed out waiting for peer "+
"(peerID:%v, chanID:%x)", resCtx.peer.IdentityKey(), "(peer_id:%v, chan_id:%x)", resCtx.peer.IdentityKey(),
pendingChanID[:]) pendingChanID[:])
fndgLog.Warnf(err.Error()) fndgLog.Warnf(err.Error())
f.failFundingFlow(resCtx.peer, pendingChanID, err) f.failFundingFlow(resCtx.peer, pendingChanID, err)