Skip to content

server: fix registration edge case check when the address is already registered #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

0xnightwind
Copy link

this is an edge case - if the wallet is already registered and say the node is moved to some other machine or if the repo is deleted and started all over again then there wouldn't be any file at ../node-lite/register-tx-hash.txt because contracts/lite-register.js would return from if (await checkIfRegistered(signerAddress)) condition and would not write anything to txHashPath in fs.writeFileSync(txHashPath, tx.hash);. So now the server code checks if the signer address is already registered and thus prevents the error caused in node-lite/register.js's Step:5 console.log(orange.bold('\n🔶 Step 5: Server Registration')).

…registered

this is an edge case - if the wallet is already registered and say the node
is moved to some other machine or if the repo is deleted and started all over again
then there wouldn't be any file at ../node-lite/register-tx-hash.txt because contracts/lite-register.js
would return from `if (await checkIfRegistered(signerAddress))` condition and would not write anything
to txHashPath in `fs.writeFileSync(txHashPath, tx.hash);`. So now the server code checks if the
signer address is already registered and thus prevents the error caused in `node-lite/register.js`'s
`Step:5 console.log(orange.bold('\n🔶 Step 5: Server Registration'))`.

Signed-off-by: 0xnightwind <[email protected]>
@0xnightwind
Copy link
Author

@NetrumLabs ? @

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant