add non null assertion

This commit is contained in:
Antoni Spaanderman 2022-03-08 20:59:46 +01:00
parent 933f34ef73
commit 95b8a77bf1

View File

@ -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;
}
}); });
} }