Skip to content
This repository has been archived by the owner on Feb 21, 2019. It is now read-only.

Commit

Permalink
hierarchal assets can have 8 chars per section #1181
Browse files Browse the repository at this point in the history
  • Loading branch information
nmushegian committed Dec 27, 2014
1 parent 507f130 commit 7d16b60
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion libraries/blockchain/asset_operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace bts { namespace blockchain {
// hardforks which may want to add new permissions for future
// assets without applying them to existing assets.
new_record.flags = 0;
new_record.issuer_permissions = retractable | market_halt | balance_halt | supply_unlimit;
new_record.issuer_permissions = restricted | retractable | market_halt | balance_halt | supply_unlimit;

if( issuer_account_record )
{
Expand Down
21 changes: 16 additions & 5 deletions libraries/blockchain/chain_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,30 @@ namespace bts { namespace blockchain {
*/
bool chain_interface::is_valid_symbol_name( const string& symbol )const
{ try {
if( symbol.size() < BTS_BLOCKCHAIN_MIN_SYMBOL_SIZE || symbol.size() > BTS_BLOCKCHAIN_MAX_SYMBOL_SIZE )
return false;

int dots = 0;
int sub_symbol_size = 0;
for( const char& c : symbol )
{
sub_symbol_size++;
ulog("char is: ${c}, count is: ${s}", ("c", std::string(1, c))("s", sub_symbol_size));
if( c == '.' )
{
if( sub_symbol_size < BTS_BLOCKCHAIN_MIN_SYMBOL_SIZE
|| sub_symbol_size > BTS_BLOCKCHAIN_MAX_SYMBOL_SIZE )
return false;
sub_symbol_size = 0;
ulog("it's a dot, resetting subsize to 0");

if( ++dots > 1 )
return false;
return false;
}
else
{
if( !std::isalnum( c, std::locale::classic() ) || !std::isupper( c, std::locale::classic() ) )
return false;
ulog("it's not a dot and passes basic test");
}
else if( !std::isalnum( c, std::locale::classic() ) || !std::isupper( c, std::locale::classic() ) )
return false;
}
if( symbol.back() == '.' ) return false;
if( symbol.front() == '.' ) return false;
Expand Down

0 comments on commit 7d16b60

Please sign in to comment.