We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 311c88d commit a074a52Copy full SHA for a074a52
1 file changed
src/writer/alias.ts
@@ -14,10 +14,11 @@ export async function verify(message): Promise<any> {
14
return Promise.reject('alias cannot be the same as the address');
15
}
16
17
- const [existing] = await db.queryAsync('SELECT address FROM aliases WHERE alias = ? LIMIT 1', [
18
- msg.payload.alias
19
- ]);
20
- if (existing && existing.address.toLowerCase() !== message.address.toLowerCase()) {
+ const [existing] = await db.queryAsync(
+ 'SELECT address FROM aliases WHERE alias = ? AND address != ? LIMIT 1',
+ [msg.payload.alias, message.address]
+ );
21
+ if (existing) {
22
return Promise.reject('alias is already linked to another address');
23
24
0 commit comments