Merge branch 'develop' into bug/245-exception-in-witness
This commit is contained in:
commit
745e40acb7
3 changed files with 33 additions and 32 deletions
|
|
@ -123,7 +123,7 @@ void database::reindex( fc::path data_dir )
|
||||||
}
|
}
|
||||||
for( uint32_t i = head_block_num() + 1; i <= last_block_num; ++i )
|
for( uint32_t i = head_block_num() + 1; i <= last_block_num; ++i )
|
||||||
{
|
{
|
||||||
if( i % 10000 == 0 )
|
if( i % 1000000 == 0 )
|
||||||
{
|
{
|
||||||
ilog( "Writing database to disk at block ${i}", ("i",i) );
|
ilog( "Writing database to disk at block ${i}", ("i",i) );
|
||||||
flush();
|
flush();
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,10 @@ namespace graphene { namespace db {
|
||||||
|
|
||||||
struct undo_state
|
struct undo_state
|
||||||
{
|
{
|
||||||
unordered_map<object_id_type, unique_ptr<object> > old_values;
|
unordered_map<object_id_type, unique_ptr<object> > old_values;
|
||||||
unordered_map<object_id_type, object_id_type> old_index_next_ids;
|
unordered_map<object_id_type, object_id_type> old_index_next_ids;
|
||||||
std::unordered_set<object_id_type> new_ids;
|
std::set<object_id_type, std::greater<object_id_type> > new_ids;
|
||||||
unordered_map<object_id_type, unique_ptr<object> > removed;
|
unordered_map<object_id_type, unique_ptr<object> > removed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2202,11 +2202,8 @@ public:
|
||||||
vector<std::string> owners;
|
vector<std::string> owners;
|
||||||
for(auto obj: son_objects)
|
for(auto obj: son_objects)
|
||||||
{
|
{
|
||||||
if (obj)
|
std::string acc_id = account_id_to_string(obj->son_account);
|
||||||
{
|
owners.push_back(acc_id);
|
||||||
std::string acc_id = account_id_to_string(obj->son_account);
|
|
||||||
owners.push_back(acc_id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
vector< optional< account_object> > accs = _remote_db->get_accounts(owners);
|
vector< optional< account_object> > accs = _remote_db->get_accounts(owners);
|
||||||
std::remove_if(son_objects.begin(), son_objects.end(),
|
std::remove_if(son_objects.begin(), son_objects.end(),
|
||||||
|
|
@ -2216,9 +2213,7 @@ public:
|
||||||
std::inserter(result, result.end()),
|
std::inserter(result, result.end()),
|
||||||
[](fc::optional<account_object>& acct, fc::optional<son_object> son) {
|
[](fc::optional<account_object>& acct, fc::optional<son_object> son) {
|
||||||
FC_ASSERT(acct, "Invalid active SONs list in global properties.");
|
FC_ASSERT(acct, "Invalid active SONs list in global properties.");
|
||||||
if (son.valid() && son->status != son_status::deregistered)
|
return std::make_pair<string, son_id_type>(string(acct->name), std::move(son->id));
|
||||||
return std::make_pair<string, son_id_type>(string(acct->name), std::move(son->id));
|
|
||||||
return std::make_pair<string, son_id_type>(string(acct->name), std::move(son_id_type()));
|
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
} FC_CAPTURE_AND_RETHROW() }
|
} FC_CAPTURE_AND_RETHROW() }
|
||||||
|
|
@ -4184,27 +4179,33 @@ string operation_printer::operator()(const transfer_operation& op) const
|
||||||
std::string memo;
|
std::string memo;
|
||||||
if( op.memo )
|
if( op.memo )
|
||||||
{
|
{
|
||||||
if( wallet.is_locked() )
|
bool is_encrypted = ((op.memo->from != public_key_type()) && (op.memo->to != public_key_type()));
|
||||||
{
|
if (is_encrypted) {
|
||||||
out << " -- Unlock wallet to see memo.";
|
if( wallet.is_locked() )
|
||||||
} else {
|
{
|
||||||
try {
|
out << " -- Unlock wallet to see memo.";
|
||||||
FC_ASSERT(wallet._keys.count(op.memo->to) || wallet._keys.count(op.memo->from), "Memo is encrypted to a key ${to} or ${from} not in this wallet.", ("to", op.memo->to)("from",op.memo->from));
|
} else {
|
||||||
if( wallet._keys.count(op.memo->to) ) {
|
try {
|
||||||
auto my_key = wif_to_key(wallet._keys.at(op.memo->to));
|
FC_ASSERT(wallet._keys.count(op.memo->to) || wallet._keys.count(op.memo->from), "Memo is encrypted to a key ${to} or ${from} not in this wallet.", ("to", op.memo->to)("from",op.memo->from));
|
||||||
FC_ASSERT(my_key, "Unable to recover private key to decrypt memo. Wallet may be corrupted.");
|
if( wallet._keys.count(op.memo->to) ) {
|
||||||
memo = op.memo->get_message(*my_key, op.memo->from);
|
auto my_key = wif_to_key(wallet._keys.at(op.memo->to));
|
||||||
out << " -- Memo: " << memo;
|
FC_ASSERT(my_key, "Unable to recover private key to decrypt memo. Wallet may be corrupted.");
|
||||||
} else {
|
memo = op.memo->get_message(*my_key, op.memo->from);
|
||||||
auto my_key = wif_to_key(wallet._keys.at(op.memo->from));
|
out << " -- Memo: " << memo;
|
||||||
FC_ASSERT(my_key, "Unable to recover private key to decrypt memo. Wallet may be corrupted.");
|
} else {
|
||||||
memo = op.memo->get_message(*my_key, op.memo->to);
|
auto my_key = wif_to_key(wallet._keys.at(op.memo->from));
|
||||||
out << " -- Memo: " << memo;
|
FC_ASSERT(my_key, "Unable to recover private key to decrypt memo. Wallet may be corrupted.");
|
||||||
|
memo = op.memo->get_message(*my_key, op.memo->to);
|
||||||
|
out << " -- Memo: " << memo;
|
||||||
|
}
|
||||||
|
} catch (const fc::exception& e) {
|
||||||
|
out << " -- could not decrypt memo";
|
||||||
|
elog("Error when decrypting memo: ${e}", ("e", e.to_detail_string()));
|
||||||
}
|
}
|
||||||
} catch (const fc::exception& e) {
|
|
||||||
out << " -- could not decrypt memo";
|
|
||||||
elog("Error when decrypting memo: ${e}", ("e", e.to_detail_string()));
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
memo = op.memo->get_message(private_key_type(), public_key_type());
|
||||||
|
out << " -- Memo: " << memo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fee(op.fee);
|
fee(op.fee);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue