Resolve #238: Light client now fetches chain_id from chain_properties
This commit is contained in:
parent
15c99bd65b
commit
5fbff6cf52
3 changed files with 5 additions and 1 deletions
|
|
@ -35,6 +35,8 @@ void ChainDataModel::setDatabaseAPI(fc::api<database_api> dbapi) {
|
||||||
m_db_api->subscribe_to_objects([this](const variant& d) {
|
m_db_api->subscribe_to_objects([this](const variant& d) {
|
||||||
m_dynamic_global_properties = d.as<dynamic_global_property_object>();
|
m_dynamic_global_properties = d.as<dynamic_global_property_object>();
|
||||||
}, {m_dynamic_global_properties.id});
|
}, {m_dynamic_global_properties.id});
|
||||||
|
|
||||||
|
m_chain_properties = m_db_api->get_chain_properties();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ public:
|
||||||
|
|
||||||
const graphene::chain::global_property_object& global_properties() const { return m_global_properties; }
|
const graphene::chain::global_property_object& global_properties() const { return m_global_properties; }
|
||||||
const graphene::chain::dynamic_global_property_object& dynamic_global_properties() const { return m_dynamic_global_properties; }
|
const graphene::chain::dynamic_global_property_object& dynamic_global_properties() const { return m_dynamic_global_properties; }
|
||||||
|
const graphene::chain::chain_property_object& chain_properties() const { return m_chain_properties; }
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void broadcast(Transaction* transaction);
|
void broadcast(Transaction* transaction);
|
||||||
|
|
@ -78,6 +79,7 @@ private:
|
||||||
|
|
||||||
graphene::chain::global_property_object m_global_properties;
|
graphene::chain::global_property_object m_global_properties;
|
||||||
graphene::chain::dynamic_global_property_object m_dynamic_global_properties;
|
graphene::chain::dynamic_global_property_object m_dynamic_global_properties;
|
||||||
|
graphene::chain::chain_property_object m_chain_properties;
|
||||||
|
|
||||||
ObjectId m_account_query_num = -1;
|
ObjectId m_account_query_num = -1;
|
||||||
account_multi_index_type m_accounts;
|
account_multi_index_type m_accounts;
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ void GrapheneApplication::signTransaction(Transaction* transaction) const
|
||||||
return &model()->getAccount(id.instance.value)->accountObject().owner;
|
return &model()->getAccount(id.instance.value)->accountObject().owner;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto& chainId = model()->global_properties().chain_id;
|
auto& chainId = model()->chain_properties().chain_id;
|
||||||
auto& trx = transaction->internalTransaction();
|
auto& trx = transaction->internalTransaction();
|
||||||
trx.set_reference_block(model()->dynamic_global_properties().head_block_id);
|
trx.set_reference_block(model()->dynamic_global_properties().head_block_id);
|
||||||
flat_set<public_key_type> pubKeys = wallet()->getAvailablePrivateKeys();
|
flat_set<public_key_type> pubKeys = wallet()->getAvailablePrivateKeys();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue