add non null assertion
This commit is contained in:
parent
7a1a903599
commit
b2f9c7db2d
@ -42,10 +42,7 @@ class BitcoinApi implements AbstractBitcoinApi {
|
|||||||
$getBlockHeightTip(): Promise<number> {
|
$getBlockHeightTip(): Promise<number> {
|
||||||
return this.bitcoindClient.getChainTips()
|
return this.bitcoindClient.getChainTips()
|
||||||
.then((result: IBitcoinApi.ChainTips[]) => {
|
.then((result: IBitcoinApi.ChainTips[]) => {
|
||||||
const activeTip = result.find(tip => tip.status === 'active');
|
return result.find(tip => tip.status === 'active')!.height;
|
||||||
if (activeTip) {
|
|
||||||
return activeTip.height;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user