digest_accumulator picks out bm_create and bmg_create and reworked duplicate check
This commit is contained in:
parent
75e339e42f
commit
87bf4be89b
1 changed files with 19 additions and 14 deletions
|
|
@ -57,6 +57,8 @@ namespace {
|
||||||
{
|
{
|
||||||
for (auto& operation: proposal.proposed_ops)
|
for (auto& operation: proposal.proposed_ops)
|
||||||
{
|
{
|
||||||
|
if( operation.op.which() != graphene::chain::operation::tag<graphene::chain::betting_market_group_create_operation>::value
|
||||||
|
&& operation.op.which() != graphene::chain::operation::tag<graphene::chain::betting_market_create_operation>::value )
|
||||||
proposed_operations_digests.push_back(fc::digest(operation.op));
|
proposed_operations_digests.push_back(fc::digest(operation.op));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -478,10 +480,12 @@ void database_api_impl::check_transaction_for_duplicated_operations(const signed
|
||||||
const auto& pidx = dynamic_cast<const primary_index<proposal_index>&>(idx);
|
const auto& pidx = dynamic_cast<const primary_index<proposal_index>&>(idx);
|
||||||
const auto& raidx = pidx.get_secondary_index<graphene::chain::required_approval_index>();
|
const auto& raidx = pidx.get_secondary_index<graphene::chain::required_approval_index>();
|
||||||
|
|
||||||
auto& p_set = raidx._account_to_proposals.find( GRAPHENE_WITNESS_ACCOUNT )->second;
|
auto acc_itr = raidx._account_to_proposals.find( GRAPHENE_WITNESS_ACCOUNT );
|
||||||
|
if( acc_itr != raidx._account_to_proposals.end() )
|
||||||
|
{
|
||||||
|
auto& p_set = acc_itr->second;
|
||||||
|
|
||||||
std::set<fc::sha256> existed_operations_digests;
|
std::set<fc::sha256> existed_operations_digests;
|
||||||
|
|
||||||
for( auto p_itr = p_set.begin(); p_itr != p_set.end(); ++p_itr )
|
for( auto p_itr = p_set.begin(); p_itr != p_set.end(); ++p_itr )
|
||||||
{
|
{
|
||||||
for( auto& operation : (*p_itr)(_db).proposed_transaction.operations )
|
for( auto& operation : (*p_itr)(_db).proposed_transaction.operations )
|
||||||
|
|
@ -495,6 +499,7 @@ void database_api_impl::check_transaction_for_duplicated_operations(const signed
|
||||||
{
|
{
|
||||||
FC_ASSERT(existed_operations_digests.count(digest) == 0, "Proposed operation is already pending for apsproval.");
|
FC_ASSERT(existed_operations_digests.count(digest) == 0, "Proposed operation is already pending for apsproval.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue