Bitcoin-Qt: harmonize 2 setClientModel() functions
- harmonize BitcoinGUI::setClientModel() and RPCConsole::setClientModel() - now RPCConsole::setClientModel() also includes a direct call to setNumBlocks()
This commit is contained in:
parent
fa9e5adddd
commit
1fc57d568b
1 changed files with 4 additions and 2 deletions
|
@ -254,8 +254,11 @@ void RPCConsole::setClientModel(ClientModel *model)
|
||||||
this->clientModel = model;
|
this->clientModel = model;
|
||||||
if(model)
|
if(model)
|
||||||
{
|
{
|
||||||
// Subscribe to information, replies, messages, errors
|
// Keep up to date with client
|
||||||
|
setNumConnections(model->getNumConnections());
|
||||||
connect(model, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
|
connect(model, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int)));
|
||||||
|
|
||||||
|
setNumBlocks(model->getNumBlocks(), model->getNumBlocksOfPeers());
|
||||||
connect(model, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int)));
|
connect(model, SIGNAL(numBlocksChanged(int,int)), this, SLOT(setNumBlocks(int,int)));
|
||||||
|
|
||||||
// Provide initial values
|
// Provide initial values
|
||||||
|
@ -264,7 +267,6 @@ void RPCConsole::setClientModel(ClientModel *model)
|
||||||
ui->buildDate->setText(model->formatBuildDate());
|
ui->buildDate->setText(model->formatBuildDate());
|
||||||
ui->startupTime->setText(model->formatClientStartupTime());
|
ui->startupTime->setText(model->formatClientStartupTime());
|
||||||
|
|
||||||
setNumConnections(model->getNumConnections());
|
|
||||||
ui->isTestNet->setChecked(model->isTestNet());
|
ui->isTestNet->setChecked(model->isTestNet());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue