@onryo what incorrect privkey did you use to find this bug? It would be good to have a test case.
This bug seems to be caused because doImport returns void, so the code that calls it doesn't know when it fails. Also, the private keys are not validated to look reasonable before calling doImport . We have a function isValidSaplingPrivateKey() we can use but we need a similar function for taddr privkeys.
@onryo what incorrect privkey did you use to find this bug? It would be good to have a test case.
This bug seems to be caused because `doImport` returns void, so the code that calls it doesn't know when it fails. Also, the private keys are not validated to look reasonable before calling `doImport` . We have a function `isValidSaplingPrivateKey()` we can use but we need a similar function for taddr privkeys.
I just pushed a commit to the branch that implements a isValidTransparentPrivateKey function (not perfect but better than nothing), which is not used anywhere yet. We should be able to use it, along with isValidSaplingPrivateKey to filter out invalid privkeys from being imported and avoid this bug.
I just pushed a commit to the branch that implements a `isValidTransparentPrivateKey` function (not perfect but better than nothing), which is not used anywhere yet. We should be able to use it, along with `isValidSaplingPrivateKey` to filter out invalid privkeys from being imported and avoid this bug.
https://git.hush.is/hush/SilentDragon/src/branch/dev/src/mainwindow.cpp#L1289
Also "it may take several minutes" is a severe underestimate , we should probably change that text.
@onryo what incorrect privkey did you use to find this bug? It would be good to have a test case.
This bug seems to be caused because
doImport
returns void, so the code that calls it doesn't know when it fails. Also, the private keys are not validated to look reasonable before callingdoImport
. We have a functionisValidSaplingPrivateKey()
we can use but we need a similar function for taddr privkeys.I just pushed a commit to the branch that implements a
isValidTransparentPrivateKey
function (not perfect but better than nothing), which is not used anywhere yet. We should be able to use it, along withisValidSaplingPrivateKey
to filter out invalid privkeys from being imported and avoid this bug.Since the
import
branch was merged todev
we now validate private keys for taddrs/zaddr much more strictly, so I am considering this bug fixed