Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions libraries/chain/account_evaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* THE SOFTWARE.
*/

#include <graphene/protocol/account_name_validation.hpp>
#include <graphene/chain/account_evaluator.hpp>
#include <graphene/chain/buyback.hpp>
#include <graphene/chain/buyback_object.hpp>
Expand Down Expand Up @@ -124,6 +125,9 @@ void_result account_create_evaluator::do_evaluate( const account_create_operatio

FC_ASSERT( fee_paying_account->is_lifetime_member(), "Only Lifetime members may register an account." );
FC_ASSERT( op.referrer(d).is_member(d.head_block_time()), "The referrer must be either a lifetime or annual subscriber." );
FC_ASSERT(graphene::protocol::account_name_validator::is_valid_account_name(op.name),
"Account name '${name}' matches known blockchain address pattern and cannot be registered",
("name", op.name));

try
{
Expand Down
1 change: 1 addition & 0 deletions libraries/protocol/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
file(GLOB HEADERS "include/graphene/protocol/*.hpp")

list(APPEND SOURCES account.cpp
account_name_validation.cpp
assert.cpp
asset_ops.cpp
block.cpp
Expand Down
7 changes: 7 additions & 0 deletions libraries/protocol/account.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <graphene/protocol/account_name_validation.hpp>
#include <graphene/protocol/account.hpp>

#include <fc/io/raw.hpp>
Expand Down Expand Up @@ -63,6 +64,12 @@ namespace graphene { namespace protocol {
*/
bool is_valid_name( const string& name )
{ try {

if( not is_valid_account_name(name) )
{
return false;
}

const size_t len = name.size();

if( len < GRAPHENE_MIN_ACCOUNT_NAME_LENGTH )
Expand Down
Loading