u
This commit is contained in:
		
							parent
							
								
									c9dbded768
								
							
						
					
					
						commit
						42128a6c8e
					
				
							
								
								
									
										1
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								index.js
									
									
									
									
									
								
							@ -61,6 +61,7 @@ module.exports = {
 | 
				
			|||||||
    //// for bip39. 注意,bip39对当前defaultWordlist之外其他语言的合法 mnemonic 也返回 false,这一点不如 bitcore-mnemonic. 所以不能直接 bip39.validateMnemonic(secword)
 | 
					    //// for bip39. 注意,bip39对当前defaultWordlist之外其他语言的合法 mnemonic 也返回 false,这一点不如 bitcore-mnemonic. 所以不能直接 bip39.validateMnemonic(secword)
 | 
				
			||||||
    if (typeof secword==='string' && 12===secword.split(/ +/).length) {
 | 
					    if (typeof secword==='string' && 12===secword.split(/ +/).length) {
 | 
				
			||||||
      for (let lang of Object.keys(bip39.wordlists)) {
 | 
					      for (let lang of Object.keys(bip39.wordlists)) {
 | 
				
			||||||
 | 
					        bip39.setDefaultWordlist(lang)
 | 
				
			||||||
        if (bip39.validateMnemonic(secword))
 | 
					        if (bip39.validateMnemonic(secword))
 | 
				
			||||||
          return true
 | 
					          return true
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user