mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02:00
lnwallet+lnrpc: convert GetCurrentHeight to GetBestBlock in BlockChainIO
This commit expands the data returned by the current GetCurrentHeight to also return the current best block hash, expanding the method into GetBestBlock. Additionally, the current best BlockHash is also now displayed within the GetInfo RPC call.
This commit is contained in:
@ -422,7 +422,7 @@ func (r *rpcServer) GetInfo(ctx context.Context,
|
||||
pendingChannels := r.server.fundingMgr.NumPendingChannels()
|
||||
idPub := r.server.identityPriv.PubKey().SerializeCompressed()
|
||||
|
||||
currentHeight, err := r.server.bio.GetCurrentHeight()
|
||||
bestHash, bestHeight, err := r.server.bio.GetBestBlock()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -437,7 +437,8 @@ func (r *rpcServer) GetInfo(ctx context.Context,
|
||||
NumPendingChannels: pendingChannels,
|
||||
NumActiveChannels: activeChannels,
|
||||
NumPeers: uint32(len(serverPeers)),
|
||||
BlockHeight: uint32(currentHeight),
|
||||
BlockHeight: uint32(bestHeight),
|
||||
BlockHash: bestHash.String(),
|
||||
SyncedToChain: isSynced,
|
||||
Testnet: activeNetParams.Params == &chaincfg.TestNet3Params,
|
||||
}, nil
|
||||
|
Reference in New Issue
Block a user