server: make sendToPeer async
This commit removes another case of unnecessary blockage, by modifying the sendToPeer method to be fully asynchronous. From the PoV of the callers that utilize this method currently, there’s no reason to block until the completion of this method. Additionally, as the graph grows larger without more intelligent the number of messages sent during initial dump will start to be prohibitive to waiting for full completion before proceeding.
This commit is contained in:
parent
6db90ef09a
commit
b7704e2de3
@ -908,7 +908,7 @@ func (s *server) sendToPeer(target *btcec.PublicKey, msgs []lnwire.Message) erro
|
||||
return err
|
||||
}
|
||||
|
||||
s.sendPeerMessages(targetPeer, msgs)
|
||||
go s.sendPeerMessages(targetPeer, msgs)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user