Skip to content

Commit 1140537

Browse files
committed
use FoundBlock() interface instead of removed getBlockTime()
bitcoin/bitcoin#17954
1 parent 210439d commit 1140537

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

qml/models/chainmodel.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
#include <QTime>
1111
#include <interfaces/chain.h>
1212

13+
using interfaces::FoundBlock;
14+
1315
ChainModel::ChainModel(interfaces::Chain& chain)
1416
: m_chain{chain}
1517
{
@@ -77,7 +79,10 @@ void ChainModel::setTimeRatioListInitial()
7779
}
7880

7981
for (int height = first_block_height; height < active_chain_height + 1; height++) {
80-
m_time_ratio_list.push_back(double(m_chain.getBlockTime(height) - time_at_meridian) / SECS_IN_12_HOURS);
82+
uint256 block_hash{m_chain.getBlockHash(height)};
83+
int64_t block_time;
84+
m_chain.findBlock(block_hash, FoundBlock().time(block_time));
85+
m_time_ratio_list.push_back(double(block_time - time_at_meridian) / SECS_IN_12_HOURS);
8186
}
8287

8388
Q_EMIT timeRatioListChanged();

0 commit comments

Comments
 (0)