lnwallet/lnrpc: Expose sync status to gRPC interface

This commit adds wallet_best_block_timestamp to the gRPC interface.
This is done in order to allow clients to calculate progress while
lnd syncs to the blockchain. wallet_best_block_timestamp is exposed
via the GetInfo() rpc call. Additionally, IsSynced() returns the
WalletBestBlockTimestamp as the second value in the tuple
that is returned, providing additional detail when querying about the
status of the sync. The BtcWallet interface has also been updated
accordingly.

This commit was created to support the issue to
[Add progress bar for chain sync] (lightninglabs/lightning-app#10) in
lightning-app
This commit is contained in:
Jason Dufair authored and Olaoluwa Osuntokun committed 2018-02-20 19:00:06 -08:00
1 parent 2a61ccec96
commit 84551c616f
9 files changed
+361 -336

No files matched your search

+2 -2
View File
@@ -262,8 +262,8 @@ func (m *mockWalletController) PublishTransaction(tx *wire.MsgTx) error {
func (*mockWalletController) SubscribeTransactions() (lnwallet.TransactionSubscription, error) {
return nil, nil
}
func (*mockWalletController) IsSynced() (bool, error) {
return true, nil
func (*mockWalletController) IsSynced() (bool, int64, error) {
return true, int64(0), nil
}
func (*mockWalletController) Start() error {
return nil