Skip to content

Commit

Permalink
Check owner authority before active authority #944
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore committed Aug 14, 2018
1 parent b4a8f86 commit 67b003b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions libraries/chain/protocol/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,20 +279,21 @@ void verify_authority( const vector<operation>& ops, const flat_set<public_key_t
}

// fetch all of the top level authorities
for( auto id : required_active )
{
GRAPHENE_ASSERT( s.check_authority(id) ||
s.check_authority(get_owner(id)),
tx_missing_active_auth, "Missing Active Authority ${id}", ("id",id)("auth",*get_active(id))("owner",*get_owner(id)) );
}

for( auto id : required_owner )
{
GRAPHENE_ASSERT( owner_approvals.find(id) != owner_approvals.end() ||
s.check_authority(get_owner(id)),
s.check_authority(get_owner(id)),
tx_missing_owner_auth, "Missing Owner Authority ${id}", ("id",id)("auth",*get_owner(id)) );
}

for( auto id : required_active )
{
GRAPHENE_ASSERT( s.check_authority(id) ||
s.check_authority(get_owner(id)),
tx_missing_active_auth, "Missing Active Authority ${id}",
("id",id)("auth",*get_active(id))("owner",*get_owner(id)) );
}

GRAPHENE_ASSERT(
!s.remove_unused_signatures(),
tx_irrelevant_sig,
Expand Down

0 comments on commit 67b003b

Please sign in to comment.