multi: Unify use of NodeKey in log messages

This commit is contained in:
MeshCollider 2018-02-20 12:01:23 +13:00 committed by Olaoluwa Osuntokun
parent 4c42079436
commit 2c2ed3c6a9
3 changed files with 10 additions and 10 deletions

@ -274,7 +274,7 @@ func (p *peer) Start() error {
// registering them with the switch and launching the necessary // registering them with the switch and launching the necessary
// goroutines required to operate them. // goroutines required to operate them.
peerLog.Debugf("Loaded %v active channels from database with "+ peerLog.Debugf("Loaded %v active channels from database with "+
"peerIDKey(%x)", len(activeChans), p.PubKey()) "NodeKey(%x)", len(activeChans), p.PubKey())
if err := p.loadActiveChannels(activeChans); err != nil { if err := p.loadActiveChannels(activeChans); err != nil {
return fmt.Errorf("unable to load channels: %v", err) return fmt.Errorf("unable to load channels: %v", err)
} }
@ -308,7 +308,7 @@ func (p *peer) loadActiveChannels(chans []*channeldb.OpenChannel) error {
p.activeChannels[chanID] = lnChan p.activeChannels[chanID] = lnChan
p.activeChanMtx.Unlock() p.activeChanMtx.Unlock()
peerLog.Infof("peerIDKey(%x) loading ChannelPoint(%v)", p.PubKey(), chanPoint) peerLog.Infof("NodeKey(%x) loading ChannelPoint(%v)", p.PubKey(), chanPoint)
// Skip adding any permanently irreconcilable channels to the // Skip adding any permanently irreconcilable channels to the
// htlcswitch. // htlcswitch.
@ -1245,7 +1245,7 @@ out:
p.activeChanMtx.Unlock() p.activeChanMtx.Unlock()
peerLog.Infof("New channel active ChannelPoint(%v) "+ peerLog.Infof("New channel active ChannelPoint(%v) "+
"with peerIDKey(%x)", chanPoint, p.PubKey()) "with NodeKey(%x)", chanPoint, p.PubKey())
// Next, we'll assemble a ChannelLink along with the // Next, we'll assemble a ChannelLink along with the
// necessary items it needs to function. // necessary items it needs to function.
@ -1302,7 +1302,7 @@ out:
// local payments and also passively forward payments. // local payments and also passively forward payments.
if err := p.server.htlcSwitch.AddLink(link); err != nil { if err := p.server.htlcSwitch.AddLink(link); err != nil {
peerLog.Errorf("can't register new channel "+ peerLog.Errorf("can't register new channel "+
"link(%v) with peerIdKey(%x)", chanPoint, p.PubKey()) "link(%v) with NodeKey(%x)", chanPoint, p.PubKey())
} }
close(newChanReq.done) close(newChanReq.done)

@ -668,7 +668,7 @@ func (r *rpcServer) DisconnectPeer(ctx context.Context,
func (r *rpcServer) OpenChannel(in *lnrpc.OpenChannelRequest, func (r *rpcServer) OpenChannel(in *lnrpc.OpenChannelRequest,
updateStream lnrpc.Lightning_OpenChannelServer) error { updateStream lnrpc.Lightning_OpenChannelServer) error {
rpcsLog.Tracef("[openchannel] request to identityPub(%v) "+ rpcsLog.Tracef("[openchannel] request to NodeKey(%v) "+
"allocation(us=%v, them=%v)", in.NodePubkeyString, "allocation(us=%v, them=%v)", in.NodePubkeyString,
in.LocalFundingAmount, in.PushSat) in.LocalFundingAmount, in.PushSat)
@ -766,7 +766,7 @@ out:
for { for {
select { select {
case err := <-errChan: case err := <-errChan:
rpcsLog.Errorf("unable to open channel to identityPub(%x): %v", rpcsLog.Errorf("unable to open channel to NodeKey(%x): %v",
nodePubKeyBytes, err) nodePubKeyBytes, err)
return err return err
case fundingUpdate := <-updateChan: case fundingUpdate := <-updateChan:
@ -803,7 +803,7 @@ out:
} }
} }
rpcsLog.Tracef("[openchannel] success identityPub(%x), ChannelPoint(%v)", rpcsLog.Tracef("[openchannel] success NodeKey(%x), ChannelPoint(%v)",
nodePubKeyBytes, outpoint) nodePubKeyBytes, outpoint)
return nil return nil
} }
@ -815,7 +815,7 @@ out:
func (r *rpcServer) OpenChannelSync(ctx context.Context, func (r *rpcServer) OpenChannelSync(ctx context.Context,
in *lnrpc.OpenChannelRequest) (*lnrpc.ChannelPoint, error) { in *lnrpc.OpenChannelRequest) (*lnrpc.ChannelPoint, error) {
rpcsLog.Tracef("[openchannel] request to identityPub(%v) "+ rpcsLog.Tracef("[openchannel] request to NodeKey(%v) "+
"allocation(us=%v, them=%v)", in.NodePubkeyString, "allocation(us=%v, them=%v)", in.NodePubkeyString,
in.LocalFundingAmount, in.PushSat) in.LocalFundingAmount, in.PushSat)
@ -883,7 +883,7 @@ func (r *rpcServer) OpenChannelSync(ctx context.Context,
select { select {
// If an error occurs them immediately return the error to the client. // If an error occurs them immediately return the error to the client.
case err := <-errChan: case err := <-errChan:
rpcsLog.Errorf("unable to open channel to identityPub(%x): %v", rpcsLog.Errorf("unable to open channel to NodeKey(%x): %v",
nodepubKey, err) nodepubKey, err)
return nil, err return nil, err

@ -1807,7 +1807,7 @@ func (s *server) OpenChannel(nodeKey *btcec.PublicKey,
s.mu.RUnlock() s.mu.RUnlock()
if targetPeer == nil { if targetPeer == nil {
errChan <- fmt.Errorf("unable to find peer nodeID(%x)", pubKeyBytes) errChan <- fmt.Errorf("unable to find peer NodeKey(%x)", pubKeyBytes)
return updateChan, errChan return updateChan, errChan
} }