fundingmanager: send messages to peers directly

In this commit, we modify the existing message sending functionality
within the fundingmanager. Due to each mesage send requiring to hold the
server's lock to retrieve the peer, we might run into a case where the
lock is held for a larger than usual amount of time and would therefore
block on sending the message within the fundingmanager. We remedy this
by taking a similar approach to some recent changes within the gossiper.
We now keep track of each peer within the internal fundingmanager
messages and send messages directly to them.
This commit is contained in:
Wilmer Paulino committed 2018-07-19 12:34:11 -07:00
1 parent e669e90017
commit 9cedef9245
3 files changed
+117 -152

No files matched your search

+1 -1
View File
@@ -2520,7 +2520,7 @@ func (s *server) OpenChannel(nodeKey *btcec.PublicKey,
// TODO(roasbeef): pass in chan that's closed if/when funding succeeds
// so can track as persistent peer?
go s.fundingMgr.initFundingWorkflow(targetPeer.addr, req)
go s.fundingMgr.initFundingWorkflow(targetPeer, req)
return updateChan, errChan
}