aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-07-03 12:23:39 +0200
committerRiccardo Spagni <ric@spagni.net>2017-07-03 12:23:39 +0200
commit9e1ded69ddfc4cc9a4fb3d6bead5e23ed2612e12 (patch)
treed94233a4167e4d04ab50781ad844dc632f6b446f
parentMerge pull request #2098 (diff)
parentelectrum-words: fix seed mistakenly thought to be old style (diff)
downloadmonero-9e1ded69ddfc4cc9a4fb3d6bead5e23ed2612e12.tar.xz
Merge pull request #2106
bb708ab8 electrum-words: fix seed mistakenly thought to be old style (moneromooo-monero)
-rw-r--r--src/mnemonics/electrum-words.cpp5
-rw-r--r--src/mnemonics/electrum-words.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/mnemonics/electrum-words.cpp b/src/mnemonics/electrum-words.cpp
index ef1100a10..3b1dc53d7 100644
--- a/src/mnemonics/electrum-words.cpp
+++ b/src/mnemonics/electrum-words.cpp
@@ -422,10 +422,11 @@ namespace crypto
* \param seed The seed to check (a space delimited concatenated word list)
* \return true if the seed passed is a old style seed false if not.
*/
- bool get_is_old_style_seed(const std::string &seed)
+ bool get_is_old_style_seed(std::string seed)
{
std::vector<std::string> word_list;
- boost::split(word_list, seed, boost::is_any_of(" "));
+ boost::algorithm::trim(seed);
+ boost::split(word_list, seed, boost::is_any_of(" "), boost::token_compress_on);
return word_list.size() != (seed_length + 1);
}
diff --git a/src/mnemonics/electrum-words.h b/src/mnemonics/electrum-words.h
index 3655dd201..94ce9c200 100644
--- a/src/mnemonics/electrum-words.h
+++ b/src/mnemonics/electrum-words.h
@@ -92,7 +92,7 @@ namespace crypto
* \param seed The seed to check (a space delimited concatenated word list)
* \return true if the seed passed is a old style seed false if not.
*/
- bool get_is_old_style_seed(const std::string &seed);
+ bool get_is_old_style_seed(std::string seed);
}
}