From da5ef56a357bc8a06b90b6594ae3cbc4dd7a8da4 Mon Sep 17 00:00:00 2001 From: Eric Frias Date: Tue, 30 Aug 2016 14:18:21 -0400 Subject: [PATCH] Cherry-picked commit 9089292. Prevent creation of accounts with the same name as dividend distribution accounts --- libraries/chain/protocol/account.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/chain/protocol/account.cpp b/libraries/chain/protocol/account.cpp index a63e6f80..3aed8fb3 100644 --- a/libraries/chain/protocol/account.cpp +++ b/libraries/chain/protocol/account.cpp @@ -23,7 +23,7 @@ */ #include #include - +#include namespace graphene { namespace chain { /** @@ -135,6 +135,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; } FC_CAPTURE_AND_RETHROW( (name) ) }