Fix segfault

This commit is contained in:
Srdjan Obucina 2020-04-14 07:48:59 +02:00
parent 703a13dab4
commit 3f71b7de1f

View file

@ -983,8 +983,10 @@ bool sidechain_net_handler_bitcoin::process_proposal(const proposal_object &po)
const auto &idx = database.get_index_type<son_wallet_index>().indices().get<by_id>();
const auto swo = idx.find(object_id);
if (swo != idx.end()) {
const auto prec_swo = std::next(swo);
tx_str = create_primary_wallet_transaction(*prec_swo, new_pw_address);
const auto prec_swo = idx.find(son_wallet_id_type(object_id.instance() - 1));
if (prec_swo != idx.end()) {
tx_str = create_primary_wallet_transaction(*prec_swo, new_pw_address);
}
}
}