Prevent creation of accounts with the same name as dividend distribution accounts
This commit is contained in:
parent
be6ad130d9
commit
908929210b
1 changed files with 8 additions and 1 deletions
|
|
@ -22,7 +22,8 @@
|
||||||
* THE SOFTWARE.
|
* THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
#include <graphene/chain/protocol/account.hpp>
|
#include <graphene/chain/protocol/account.hpp>
|
||||||
|
#include <graphene/chain/hardfork.hpp>
|
||||||
|
#include <boost/algorithm/string/predicate.hpp>
|
||||||
namespace graphene { namespace chain {
|
namespace graphene { namespace chain {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -118,6 +119,12 @@ bool is_valid_name( const string& name )
|
||||||
break;
|
break;
|
||||||
begin = end+1;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue