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:
4 files changed
+33
-34
No files matched your search
@@ -6,17 +6,12 @@ import (
|
||||
"github.com/roasbeef/btcd/wire"
|
||||
)
|
||||
|
||||
// GetCurrentHeight returns the current height of the known block within the
|
||||
// main chain.
|
||||
// GetBestBlock returns the current height and hash of the best known block
|
||||
// within the main chain.
|
||||
//
|
||||
// This method is a part of the lnwallet.BlockChainIO interface.
|
||||
func (b *BtcWallet) GetCurrentHeight() (int32, error) {
|
||||
_, height, err := b.rpc.GetBestBlock()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return height, nil
|
||||
func (b *BtcWallet) GetBestBlock() (*wire.ShaHash, int32, error) {
|
||||
return b.rpc.GetBestBlock()
|
||||
}
|
||||
|
||||
// GetTxOut returns the original output referenced by the passed outpoint.
|
||||
|
||||
Reference in new issue
Block a user