lnd: add async updates for [open|close]channel RPC's

This commit modifies the internal workflow for opening or closing a
channel in order to create a path in which RPC clients can receive
updates. Updates are now communicated via channels from the goroutines
spawned by the RPC server to process the request, and the sub-system
within the daemon that actually executes the request.

With this change clients can now receive updates that the request is
pending (final message has been sent to the target client), or that the
request has been completed. Confirmation related updates have not yet
been implemented as that will require some changes to the ChainNotifier
interface.
This commit is contained in:
Olaoluwa Osuntokun
2016-08-30 16:52:53 -07:00
parent 05ac8d3c47
commit 832fd248cd
6 changed files with 160 additions and 115 deletions

2
lnd.go
View File

@@ -143,7 +143,7 @@ func lndMain() error {
lnrpc.RegisterLightningServer(grpcServer, server.rpcServer)
// Finally, start the grpc server listening for HTTP/2 connections.
lis, err := net.Listen("tcp", fmt.Sprintf(":%d", loadedConfig.RPCPort))
lis, err := net.Listen("tcp", fmt.Sprintf("localhost:%d", loadedConfig.RPCPort))
if err != nil {
fmt.Printf("failed to listen: %v", err)
return err