The error details are:
In file included from qt/clientmodel.cpp:5:0:
qt/clientmodel.h: In function ‘void BlockTipChanged(ClientModel*, bool, const CBlockIndex*)’:
qt/clientmodel.h:92:10: error: ‘void ClientModel::numBlocksChanged(int, const QDateTime&, double)’ is protected
void numBlocksChanged(int count, const QDateTime& blockDate, double nVerificationProgress);
^
qt/clientmodel.cpp:256:154: error: within this context
Q_EMIT clientmodel->numBlocksChanged(pIndex->nHeight, QDateTime::fromTime_t(pIndex->GetBlockTime()), clientmodel->getVerificationProgress(pIndex));
^
It looks like a static function is trying to call a private method of ClientModel. There are two ways to fix this problem:
- Declare numBlocksChanged as a friend of class ClientModel.
- Add another public method to call line 256 instead of putting it in a static method outside class.
I tried two approaches and both of them work. Which one is better?
Btw, I am new here. I am trying to join bitcoin community and hope I can make more contributions.