From 908929210b38acb1c4d754b62920c554c29c240b Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Tue, 30 Aug 2016 14:18:21 -0400 Subject: [PATCH] Prevent creation of accounts with the same name as dividend distribution accounts --- libraries/chain/protocol/account.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libraries/chain/protocol/account.cpp b/libraries/chain/protocol/account.cpp index b3ad9e00..ce6812da 100644 --- a/libraries/chain/protocol/account.cpp +++ b/libraries/chain/protocol/account.cpp @@ -22,7 +22,8 @@ * THE SOFTWARE. */ #include - +#include +#include namespace graphene { namespace chain { /** @@ -118,6 +119,12 @@ bool is_valid_name( const string& name ) break; begin = end+1; } + + // only dividend distribution accounts linked to a dividend asset can end in -dividend-distribution, and + // these can only be created as a side-effect of the asset_update_dividend_operation + if( boost::algorithm::ends_with(name, "-dividend-distribution") ) + return false; + return true; }