in the process of designing a cryptocurrency payment gateway, I faced this issue. in tronweb library there is a method called tronWeb.trx.getCurrentBlock() the problem is this method returns the latest block but this block in unconfirmed. so how can I get the latest confirmed block?
I tried this way:
console.log("current block", await tronWeb.trx.getCurrentBlock());
and quickly checked the result in tronscan but the block was unconfirmed and became confirmed after 15 secconds.
here is the solution:
This method is not mentioned in the document. I found it in the core modules of tronweb.
Hope it will be useful.