def createNewWalletFromWizard(self): entropy = None if self.walletCreationPage.isManualEncryption(): entropy = SecureBinaryData( int_to_binary(self.manualEntropyPage.pageFrame.getEntropy())) else: entropy = self.main.getExtraEntropyForKeyGen() self.newWallet = PyBtcWallet().createNewWallet( securePassphrase=self.setPassphrasePage.pageFrame.getPassphrase(), kdfTargSec=self.walletCreationPage.pageFrame.getKdfSec(), kdfMaxMem=self.walletCreationPage.pageFrame.getKdfBytes(), shortLabel=self.walletCreationPage.pageFrame.getName(), longLabel=self.walletCreationPage.pageFrame.getDescription(), doRegisterWithBDM=False, extraEntropy=entropy, ) self.newWallet.unlock(securePassphrase= SecureBinaryData(self.setPassphrasePage.pageFrame.getPassphrase())) # We always want to fill the address pool, right away. fillPoolProgress = DlgProgress(self, self.main, HBar=1, \ Title="Creating Wallet") fillPoolProgress.exec_(self.newWallet.fillAddressPool, doRegister=False, Progress=fillPoolProgress.UpdateHBar) # Reopening from file helps make sure everything is correct -- don't # let the user use a wallet that triggers errors on reading it wltpath = self.newWallet.walletPath walletFromDisk = PyBtcWallet().readWalletFile(wltpath) self.main.addWalletToApplication(walletFromDisk, walletIsNew=True)
def createNewWalletFromWizard(self): self.newWallet = PyBtcWallet().createNewWallet( \ securePassphrase=self.setPassphrasePage.pageFrame.getPassphrase(), \ kdfTargSec=self.walletCreationPage.pageFrame.getKdfSec(), \ kdfMaxMem=self.walletCreationPage.pageFrame.getKdfBytes(), \ shortLabel=self.walletCreationPage.pageFrame.getName(), \ longLabel=self.walletCreationPage.pageFrame.getDescription(), \ doRegisterWithBDM=False, \ extraEntropy=self.main.getExtraEntropyForKeyGen()) self.newWallet.unlock(securePassphrase= SecureBinaryData(self.setPassphrasePage.pageFrame.getPassphrase())) # We always want to fill the address pool, right away. fillPoolProgress = DlgProgress(self, self.main, HBar=1, \ Title="Creating Wallet") fillPoolProgress.exec_(self.newWallet.fillAddressPool, doRegister=False, Progress=fillPoolProgress.UpdateHBar) # Reopening from file helps make sure everything is correct -- don't # let the user use a wallet that triggers errors on reading it wltpath = self.newWallet.walletPath walletFromDisk = PyBtcWallet().readWalletFile(wltpath) self.main.addWalletToApplication(walletFromDisk, walletIsNew=True) if TheBDM.getBDMState() in ('Uninitialized', 'Offline'): TheBDM.registerWallet(walletFromDisk, isFresh=True, wait=False) else: self.main.newWalletList.append([walletFromDisk, True])
def createNewWalletFromWizard(self): entropy = None if self.walletCreationPage.isManualEncryption(): entropy = SecureBinaryData( int_to_binary(self.manualEntropyPage.pageFrame.getEntropy())) else: entropy = self.main.getExtraEntropyForKeyGen() self.newWallet = PyBtcWallet().createNewWallet( securePassphrase=self.setPassphrasePage.pageFrame.getPassphrase(), kdfTargSec=self.walletCreationPage.pageFrame.getKdfSec(), kdfMaxMem=self.walletCreationPage.pageFrame.getKdfBytes(), shortLabel=self.walletCreationPage.pageFrame.getName(), longLabel=self.walletCreationPage.pageFrame.getDescription(), doRegisterWithBDM=False, extraEntropy=entropy, ) self.newWallet.unlock(securePassphrase=SecureBinaryData( self.setPassphrasePage.pageFrame.getPassphrase())) # We always want to fill the address pool, right away. fillPoolProgress = DlgProgress(self, self.main, HBar=1, \ Title="Creating Wallet") fillPoolProgress.exec_(self.newWallet.fillAddressPool, doRegister=False, Progress=fillPoolProgress.UpdateHBar) # Reopening from file helps make sure everything is correct -- don't # let the user use a wallet that triggers errors on reading it wltpath = self.newWallet.walletPath walletFromDisk = PyBtcWallet().readWalletFile(wltpath) self.main.addWalletToApplication(walletFromDisk, walletIsNew=True)
def createNewWalletFromWizard(self): self.newWallet = PyBtcWallet().createNewWallet( \ securePassphrase=self.setPassphrasePage.pageFrame.getPassphrase(), \ kdfTargSec=self.walletCreationPage.pageFrame.getKdfSec(), \ kdfMaxMem=self.walletCreationPage.pageFrame.getKdfBytes(), \ shortLabel=self.walletCreationPage.pageFrame.getName(), \ longLabel=self.walletCreationPage.pageFrame.getDescription(), \ doRegisterWithBDM=False, \ extraEntropy=self.main.getExtraEntropyForKeyGen()) self.newWallet.unlock(securePassphrase=SecureBinaryData( self.setPassphrasePage.pageFrame.getPassphrase())) # We always want to fill the address pool, right away. fillPoolProgress = DlgProgress(self, self.main, HBar=1, \ Title="Creating Wallet") fillPoolProgress.exec_(self.newWallet.fillAddressPool, doRegister=False, Progress=fillPoolProgress.UpdateHBar) # Reopening from file helps make sure everything is correct -- don't # let the user use a wallet that triggers errors on reading it wltpath = self.newWallet.walletPath walletFromDisk = PyBtcWallet().readWalletFile(wltpath) self.main.addWalletToApplication(walletFromDisk, walletIsNew=True) if TheBDM.getBDMState() in ('Uninitialized', 'Offline'): TheBDM.registerWallet(walletFromDisk, isFresh=True, wait=False) else: self.main.newWalletList.append([walletFromDisk, True])
def clickedDoIt(self): isBackupCreated = False if self.passphrase: from qtdialogs import DlgProgress unlockProgress = DlgProgress(self, self.main, HBar=1, Title="Unlocking Wallet") unlockProgress.exec_(self.wlt.unlock, securePassphrase=SecureBinaryData( \ self.passphrase), Progress=unlockProgress.UpdateHBar) if self.optPaperBackupOne.isChecked(): isBackupCreated = OpenPaperBackupWindow('Single', self.parent(), self.main, self.wlt) elif self.optPaperBackupFrag.isChecked(): isBackupCreated = OpenPaperBackupWindow('Frag', self.parent(), self.main, self.wlt) elif self.optDigitalBackupPlain.isChecked(): if self.main.digitalBackupWarning(): isBackupCreated = self.main.makeWalletCopy( self, self.wlt, 'Decrypt', 'decrypt') elif self.optDigitalBackupCrypt.isChecked(): isBackupCreated = self.main.makeWalletCopy(self, self.wlt, 'Encrypt', 'encrypt') elif self.optIndivKeyListTop.isChecked(): if self.wlt.useEncryption and self.wlt.isLocked: dlg = DlgUnlockWallet(self.wlt, self, self.main, 'Unlock Private Keys') if not dlg.exec_(): if self.main.usermode == USERMODE.Expert: QMessageBox.warning(self, tr('Unlock Failed'), tr(""" Wallet was not be unlocked. The public keys and addresses will still be shown, but private keys will not be available unless you reopen the dialog with the correct passphrase."""), \ QMessageBox.Ok) else: QMessageBox.warning(self, tr('Unlock Failed'), tr(""" 'Wallet could not be unlocked to display individual keys."""), \ QMessageBox.Ok) if self.main.usermode == USERMODE.Standard: return DlgShowKeyList(self.wlt, self.parent(), self.main).exec_() isBackupCreated = True if isBackupCreated: self.isBackupCreated = True
def clickedDoIt(self): isBackupCreated = False if self.passphrase: from qtdialogs import DlgProgress unlockProgress = DlgProgress(self, self.main, HBar=1, Title="Unlocking Wallet") unlockProgress.exec_(self.wlt.unlock, securePassphrase=SecureBinaryData( \ self.passphrase), Progress=unlockProgress.UpdateHBar) if self.optPaperBackupOne.isChecked(): isBackupCreated = OpenPaperBackupWindow('Single', self.parent(), self.main, self.wlt) elif self.optPaperBackupFrag.isChecked(): isBackupCreated = OpenPaperBackupWindow('Frag', self.parent(), self.main, self.wlt) elif self.optDigitalBackupPlain.isChecked(): if self.main.digitalBackupWarning(): isBackupCreated = self.main.makeWalletCopy(self, self.wlt, 'Decrypt', 'decrypt') elif self.optDigitalBackupCrypt.isChecked(): isBackupCreated = self.main.makeWalletCopy(self, self.wlt, 'Encrypt', 'encrypt') elif self.optIndivKeyListTop.isChecked(): if self.wlt.useEncryption and self.wlt.isLocked: dlg = DlgUnlockWallet(self.wlt, self, self.main, 'Unlock Private Keys') if not dlg.exec_(): if self.main.usermode == USERMODE.Expert: QMessageBox.warning(self, tr('Unlock Failed'), tr(""" Wallet was not be unlocked. The public keys and addresses will still be shown, but private keys will not be available unless you reopen the dialog with the correct passphrase."""), \ QMessageBox.Ok) else: QMessageBox.warning(self, tr('Unlock Failed'), tr(""" 'Wallet could not be unlocked to display individual keys."""), \ QMessageBox.Ok) if self.main.usermode == USERMODE.Standard: return DlgShowKeyList(self.wlt, self.parent(), self.main).exec_() isBackupCreated = True if isBackupCreated: self.isBackupCreated = True