Fix bip39 bug before encryption
This commit is contained in:
@@ -231,6 +231,16 @@ impl Command for EncryptCommand {
|
|||||||
return self.help();
|
return self.help();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Refuse to encrypt if the bip39 bug has not been fixed
|
||||||
|
use crate::lightwallet::bugs::BugBip39Derivation;
|
||||||
|
if BugBip39Derivation::has_bug(lightclient) {
|
||||||
|
let mut h = vec![];
|
||||||
|
h.push("It looks like your wallet has the bop39bug. Please run 'fixbip39bug' to fix it");
|
||||||
|
h.push("before encrypting your wallet.");
|
||||||
|
h.push("ERROR: Cannot encrypt while wallet has the bip39bug.");
|
||||||
|
return h.join("\n");
|
||||||
|
}
|
||||||
|
|
||||||
let passwd = args[0].to_string();
|
let passwd = args[0].to_string();
|
||||||
|
|
||||||
match lightclient.wallet.write().unwrap().encrypt(passwd) {
|
match lightclient.wallet.write().unwrap().encrypt(passwd) {
|
||||||
|
|||||||
10
mkrelease.sh
10
mkrelease.sh
@@ -25,8 +25,14 @@ set -- "${POSITIONAL[@]}" # restore positional parameters
|
|||||||
|
|
||||||
if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi
|
if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi
|
||||||
|
|
||||||
# Clean everything first
|
# First, do the tests
|
||||||
cargo clean
|
cd lib && cargo test --release
|
||||||
|
retVal=$?
|
||||||
|
if [ $retVal -ne 0 ]; then
|
||||||
|
echo "Error"
|
||||||
|
exit $retVal
|
||||||
|
fi
|
||||||
|
cd ..
|
||||||
|
|
||||||
# Compile for mac directly
|
# Compile for mac directly
|
||||||
cargo build --release
|
cargo build --release
|
||||||
|
|||||||
Reference in New Issue
Block a user