Skip to content

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Jan 29, 2024
1 parent c597fb4 commit 2c150c6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,15 +489,14 @@ static UniValue getassetunlockstatuses(const JSONRPCRequest& request)
}

const auto pBlockIndexBestCL = [&]() -> const CBlockIndex* {
if (llmq_ctx.clhandler->GetBestChainLock().IsNull()) {
// If no CL info is available, try to use CbTx CL information
if (const auto cbtx_best_cl = GetNonNullCoinbaseChainlock(pTipBlockIndex)) {
return pTipBlockIndex->GetAncestor(pTipBlockIndex->nHeight - cbtx_best_cl->second - 1);
}
}
else {
if (!llmq_ctx.clhandler->GetBestChainLock().IsNull()) {
return pTipBlockIndex->GetAncestor(llmq_ctx.clhandler->GetBestChainLock().getHeight());
}
// If no CL info is available, try to use CbTx CL information
if (const auto cbtx_best_cl = GetNonNullCoinbaseChainlock(pTipBlockIndex)) {
return pTipBlockIndex->GetAncestor(pTipBlockIndex->nHeight - cbtx_best_cl->second - 1);

This comment has been minimized.

Copy link
@knst

knst Jan 29, 2024

Collaborator

if that's genesis block, is there any chance to get -1 here?

}
// no CL info, no CbTx CL
return nullptr;
}();

Expand Down

0 comments on commit 2c150c6

Please sign in to comment.