From d1f9216f8598290b514e59e2ed656c00458f7ab1 Mon Sep 17 00:00:00 2001 From: Daniel Larimer Date: Wed, 28 Oct 2015 11:51:38 -0400 Subject: [PATCH] HARDFORK enable whitelisting of everyone, but blacklisting of some --- libraries/chain/account_object.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/libraries/chain/account_object.cpp b/libraries/chain/account_object.cpp index 79729638..839a4537 100644 --- a/libraries/chain/account_object.cpp +++ b/libraries/chain/account_object.cpp @@ -38,12 +38,23 @@ share_type cut_fee(share_type a, uint16_t p) return r.to_uint64(); } -bool account_object::is_authorized_asset(const asset_object& asset_obj) const { +bool account_object::is_authorized_asset(const asset_object& asset_obj) const +{ for( const auto id : blacklisting_accounts ) - if( asset_obj.options.blacklist_authorities.find(id) != asset_obj.options.blacklist_authorities.end() ) return false; + { + if( asset_obj.options.blacklist_authorities.find(id) != asset_obj.options.blacklist_authorities.end() ) + return false; + } + + if( asset_obj.options.whitelist_authorities.size() == 0 ) + return true; for( const auto id : whitelisting_accounts ) - if( asset_obj.options.whitelist_authorities.find(id) != asset_obj.options.whitelist_authorities.end() ) return true; + { + if( asset_obj.options.whitelist_authorities.find(id) != asset_obj.options.whitelist_authorities.end() ) + return true; + } + return false; }