mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-03 10:12:28 +02:00
multi: add GetBlockHeader to BlockChainIO
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
35bfd27467
commit
b04927f688
@@ -45,6 +45,24 @@ func (h *HarnessRPC) GetBlock(
|
||||
return resp
|
||||
}
|
||||
|
||||
// GetBlockHeader makes an RPC call to chain kit client's GetBlockHeader and
|
||||
// asserts.
|
||||
func (h *HarnessRPC) GetBlockHeader(
|
||||
req *chainrpc.GetBlockHeaderRequest) *chainrpc.GetBlockHeaderResponse {
|
||||
|
||||
if req == nil {
|
||||
req = &chainrpc.GetBlockHeaderRequest{}
|
||||
}
|
||||
|
||||
ctxt, cancel := context.WithTimeout(h.runCtx, DefaultTimeout)
|
||||
defer cancel()
|
||||
|
||||
resp, err := h.ChainKit.GetBlockHeader(ctxt, req)
|
||||
h.NoError(err, "GetBlockHeader")
|
||||
|
||||
return resp
|
||||
}
|
||||
|
||||
// GetBlockHash makes an RPC call to chain kit client's GetBlockHash and
|
||||
// asserts.
|
||||
func (h *HarnessRPC) GetBlockHash(
|
||||
|
Reference in New Issue
Block a user