Commit 140fec0b authored by Adrien Béraud's avatar Adrien Béraud

contract: prevent registering multiple names

Change-Id: I1c9d1403b65fbdfb79eff1ff0ffabb89bd0a5a16
parent c7c6d74f
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment