Created
April 9, 2014 01:28
-
-
Save moeadham/10217078 to your computer and use it in GitHub Desktop.
Bitcoinjs-lib Wallet WIF error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Wallet = require('./src/wallet.js'); | |
var i = 0; | |
for(i = 0; i<5000; i++){ | |
generateAddresses(function(pub,priv){ | |
if(priv[0] == '5'){ | |
console.log('ERROR'); | |
console.log(pub); | |
console.log(priv); | |
} | |
}); | |
} | |
function generateAddresses(cb) { | |
var wallet = new Wallet(); | |
wallet.newMasterKey(); | |
pub = wallet.generateAddress(); | |
//console.log(pub); | |
//console.log(wallet); | |
var priv = wallet.getPrivateKeyForAddress(pub); | |
priv = priv.toWif(); | |
cb(pub, priv); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment