lnd: use asynchronous streaming responses for [open|close]channel RPC's

This commit switches the implementation of the open/close channel RPC’s
from a fully blocking synchronous model to one that’s async by default,
allowing callers to add a sync wrapper.

The new proto specs also allow for “updates” for the pending channels
in the form of new confirmations which progress the pending status of
the channel. At this point, only the final open/close updates have been
implemented. Obtaining confirmation notifications requires a bit of
re-working within the current ChainNotifier interface, thus this has
been deferred to a later time.
This commit is contained in:
Olaoluwa Osuntokun committed 2016-07-07 15:31:07 -07:00
1 parent dd9acfdd4d
commit c0383679d2
3 files changed
+51 -33

No files matched your search

+2 -1
View File
@@ -555,11 +555,12 @@ func (p *peer) handleLocalClose(req *closeChanReq) {
success = true
case <-p.quit:
return
}
// Respond to the local sub-system which requested the channel
// closure.
req.resp <- &closeChanResp{success}
req.resp <- &closeChanResp{txid, success}
req.err <- nil
}()
}