Skip to content
Snippets Groups Projects
Commit 140fec0b authored by Adrien Béraud's avatar Adrien Béraud
Browse files

contract: prevent registering multiple names

Change-Id: I1c9d1403b65fbdfb79eff1ff0ffabb89bd0a5a16
parent c7c6d74f
No related branches found
No related tags found
No related merge requests found
......@@ -28,14 +28,17 @@ contract GlobalRegistrar is Registrar {
function Registrar() {
}
function reserve(bytes32 _name) {
if (m_toRecord[_name].owner == 0) {
function reserve(bytes32 _name, address _a) {
if (m_toRecord[_name].owner == 0 && m_toName[_a] == 0) {
m_toRecord[_name].owner = msg.sender;
m_toRecord[_name].primary = _a;
m_toName[_a] = _name;
Changed(_name);
PrimaryChanged(_name, _a, msg.sender);
}
}
function reserveFor(bytes32 _name, address _owner, address _a) {
if (m_toRecord[_name].owner == 0) {
if (m_toRecord[_name].owner == 0 && m_toName[_a] == 0) {
m_toRecord[_name].owner = _owner;
m_toRecord[_name].primary = _a;
m_toName[_a] = _name;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment