CPChain / chain

Mirror of https://bitbucket.org/cpchain/chain
GNU General Public License v3.0
51 stars 10 forks source link

A password input problem for `./cpchain run` #85

Closed alex031029 closed 5 years ago

alex031029 commented 5 years ago

Where does the bug occur? the chain

Describe the bug Trippledutch and Ye Man from Telegram messaged me about a case of password input. When they launched the node with command ./cpchain run --unlock XXXX --mine, they cannot input password manually and the node just started syncing. As described by Tripppledutch, this problem didn't not occur each time he start the node.

Neither did Trippledutch and Yeman meet this issue until the latest 0.4.7 version, which confuses me since CPChain team does not modify any code related to ./cpchain run password input.

For users encounter a similar problem, an expedient is to use the previous 0.4.6 version which is compatible with 0.4.7.

And I appreciate anyone post screenshot or report me details on this problem. Thanks!

hvredevoort commented 5 years ago

Hi Alex, I made a short video about this issue. See your telegram because I could not paste it hete

EBB5D62A-51AD-4F46-8837-F4F20703814E

alex031029 commented 5 years ago

Thanks for the video! Now I can see the reason.

It should be a thread (which is syncing the block) is running despite the terminal is waiting for your password. In principle, the password is not necessary when syncing the block. Thus, the mining thread is waiting for your password, while the syncing thread has get new blocks synced and written info on the screen.

The reason that only very few people can reproduce is because it requires a very high network speed. The majority of users can type in the password before any block synced, while these people with high network specs can encounter the problem occasionally.

The problem should be fixed next version. Thanks again!

alex031029 commented 5 years ago

There are several expedients for this problem:

  1. Use compatible 0.4.6 version. No one has encounter this bug in 0.4.6. However, it method is not guaranteed as I said the bug only occurs occasionally.

  2. Use --password flag to assign a password file (in which the password is written in plaintext). This method is guaranteed to work.

  3. Utilize the clipboard to paste the password when inputting password is still feasible.

hvredevoort commented 5 years ago

This seems to be solved in 0.4.8

alex031029 commented 5 years ago

This problem has been fixed. And the issue is closed.