lnd: minor clean up with comments + go fmt after latest PR merge

This commit is contained in:
Olaoluwa Osuntokun 2016-08-11 11:55:56 -07:00
parent c0d59a2d85
commit 4bc315d061
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
3 changed files with 10 additions and 16 deletions

@ -617,8 +617,8 @@ func (f *fundingManager) handleFundingOpen(fmsg *fundingOpenMsg) {
fndgLog.Infof("FundingOpen: ChannelPoint(%v) with peerID(%v) is now open", fndgLog.Infof("FundingOpen: ChannelPoint(%v) with peerID(%v) is now open",
resCtx.reservation.FundingOutpoint, fmsg.peer.id) resCtx.reservation.FundingOutpoint, fmsg.peer.id)
// ROUTING ADDED capacity := float64(resCtx.reservation.OurContribution().FundingAmount +
capacity := float64(resCtx.reservation.OurContribution().FundingAmount + resCtx.reservation.TheirContribution().FundingAmount) resCtx.reservation.TheirContribution().FundingAmount)
fmsg.peer.server.routingMgr.AddChannel( fmsg.peer.server.routingMgr.AddChannel(
graph.NewID(fmsg.peer.server.lightningID), graph.NewID(fmsg.peer.server.lightningID),
graph.NewID([32]byte(fmsg.peer.lightningID)), graph.NewID([32]byte(fmsg.peer.lightningID)),

@ -17,7 +17,6 @@ import (
"github.com/roasbeef/btcd/btcec" "github.com/roasbeef/btcd/btcec"
"github.com/roasbeef/btcd/txscript" "github.com/roasbeef/btcd/txscript"
"github.com/roasbeef/btcd/wire" "github.com/roasbeef/btcd/wire"
) )
var ( var (
@ -378,15 +377,15 @@ out:
case *lnwire.CommitSignature: case *lnwire.CommitSignature:
isChanUpate = true isChanUpate = true
targetChan = msg.ChannelPoint targetChan = msg.ChannelPoint
// ROUTING ADDED
case *lnwire.NeighborAckMessage, case *lnwire.NeighborAckMessage,
*lnwire.NeighborHelloMessage, *lnwire.NeighborHelloMessage,
*lnwire.NeighborRstMessage, *lnwire.NeighborRstMessage,
*lnwire.NeighborUpdMessage, *lnwire.NeighborUpdMessage,
*lnwire.RoutingTableRequestMessage, *lnwire.RoutingTableRequestMessage,
*lnwire.RoutingTableTransferMessage: *lnwire.RoutingTableTransferMessage:
p.server.routingMgr.ChIn <- msg
// TODO(mkl): determine sender and receiver of message // TODO(mkl): determine sender and receiver of message
p.server.routingMgr.ChIn <- msg
} }
if isChanUpate { if isChanUpate {

@ -52,7 +52,6 @@ type server struct {
htlcSwitch *htlcSwitch htlcSwitch *htlcSwitch
invoices *invoiceRegistry invoices *invoiceRegistry
// ROUTING ADDED
routingMgr *routing.RoutingManager routingMgr *routing.RoutingManager
newPeers chan *peer newPeers chan *peer
@ -148,12 +147,9 @@ func (s *server) Stop() error {
} }
} }
// Shutdown the wallet, funding manager, and the rpc server.
s.rpcServer.Stop() s.rpcServer.Stop()
s.lnwallet.Shutdown() s.lnwallet.Shutdown()
s.fundingMgr.Stop() s.fundingMgr.Stop()
// ROUTING ADDED
s.routingMgr.Stop() s.routingMgr.Stop()
// Signal all the lingering goroutines to quit. // Signal all the lingering goroutines to quit.
@ -406,7 +402,6 @@ func (s *server) handleOpenChanReq(req *openChanReq) {
// TODO(roasbeef): server semaphore to restrict num goroutines // TODO(roasbeef): server semaphore to restrict num goroutines
fundingID, err := s.fundingMgr.initFundingWorkflow(targetPeer, req) fundingID, err := s.fundingMgr.initFundingWorkflow(targetPeer, req)
if err == nil { if err == nil {
// ROUTING ADDED
capacity := float64(req.localFundingAmt + req.remoteFundingAmt) capacity := float64(req.localFundingAmt + req.remoteFundingAmt)
s.routingMgr.AddChannel( s.routingMgr.AddChannel(
graph.NewID(s.lightningID), graph.NewID(s.lightningID),