htlcswitch: modify the SendMessage method on the Peer interface to optionally block

In this commit, add a new argument to the SendMessage method to allow
callers to request that the method block until the message has been sent
on the socket to the remote peer.
This commit is contained in:
Olaoluwa Osuntokun committed 2018-04-04 17:36:44 -07:00
1 parent 6fa93a78c1
commit f53a99e18e
3 files changed
+7 -4

No files matched your search

+1 -1
View File
@@ -1392,7 +1392,7 @@ type mockPeer struct {
quit chan struct{}
}
func (m *mockPeer) SendMessage(msg lnwire.Message) error {
func (m *mockPeer) SendMessage(msg lnwire.Message, sync bool) error {
select {
case m.sentMsgs <- msg:
case <-m.quit: