diff --git a/src/bitmessageqt/bitmessageui.py b/src/bitmessageqt/bitmessageui.py index fb0056aa..318c1caf 100644 --- a/src/bitmessageqt/bitmessageui.py +++ b/src/bitmessageqt/bitmessageui.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'bitmessageui.ui' # -# Created: Fri Aug 01 15:30:14 2014 +# Created: Mon Jan 05 16:21:20 2015 # by: PyQt4 UI code generator 4.10.3 # # WARNING! All changes made in this file will be lost! @@ -625,11 +625,11 @@ class Ui_MainWindow(object): item.setText(_translate("MainWindow", "Stream #", None)) item = self.tableWidgetConnectionCount.horizontalHeaderItem(1) item.setText(_translate("MainWindow", "Connections", None)) - self.labelTotalConnections.setText(_translate("MainWindow", "Total connections: 0", None)) - self.labelStartupTime.setText(_translate("MainWindow", "Since startup at asdf:", None)) - self.labelMessageCount.setText(_translate("MainWindow", "Processed 0 person-to-person message.", None)) - self.labelPubkeyCount.setText(_translate("MainWindow", "Processed 0 public key.", None)) - self.labelBroadcastCount.setText(_translate("MainWindow", "Processed 0 broadcast.", None)) + self.labelTotalConnections.setText(_translate("MainWindow", "Total connections:", None)) + self.labelStartupTime.setText(_translate("MainWindow", "Since startup:", None)) + self.labelMessageCount.setText(_translate("MainWindow", "Processed 0 person-to-person messages.", None)) + self.labelPubkeyCount.setText(_translate("MainWindow", "Processed 0 public keys.", None)) + self.labelBroadcastCount.setText(_translate("MainWindow", "Processed 0 broadcasts.", None)) self.labelLookupsPerSecond.setText(_translate("MainWindow", "Inventory lookups per second: 0", None)) self.labelBytesRecvCount.setText(_translate("MainWindow", "Down: 0 KB/s", None)) self.labelBytesSentCount.setText(_translate("MainWindow", "Up: 0 KB/s", None)) diff --git a/src/bitmessageqt/bitmessageui.ui b/src/bitmessageqt/bitmessageui.ui index cdc8fdf9..58e115d7 100644 --- a/src/bitmessageqt/bitmessageui.ui +++ b/src/bitmessageqt/bitmessageui.ui @@ -976,7 +976,7 @@ p, li { white-space: pre-wrap; } - Total connections: 0 + Total connections: @@ -989,7 +989,7 @@ p, li { white-space: pre-wrap; } - Since startup at asdf: + Since startup: @@ -1002,7 +1002,7 @@ p, li { white-space: pre-wrap; } - Processed 0 person-to-person message. + Processed 0 person-to-person messages. @@ -1015,7 +1015,7 @@ p, li { white-space: pre-wrap; } - Processed 0 public key. + Processed 0 public keys. @@ -1028,7 +1028,7 @@ p, li { white-space: pre-wrap; } - Processed 0 broadcast. + Processed 0 broadcasts. diff --git a/src/class_addressGenerator.py b/src/class_addressGenerator.py index 1a3ff5bc..af25b210 100644 --- a/src/class_addressGenerator.py +++ b/src/class_addressGenerator.py @@ -7,6 +7,7 @@ import ctypes import hashlib import highlevelcrypto from addresses import * +from debug import logger from pyelliptic import arithmetic import tr @@ -85,20 +86,19 @@ class addressGenerator(threading.Thread): potentialPrivEncryptionKey = OpenSSL.rand(32) potentialPubEncryptionKey = highlevelcrypto.pointMult( potentialPrivEncryptionKey) - # print 'potentialPubSigningKey', potentialPubSigningKey.encode('hex') - # print 'potentialPubEncryptionKey', - # potentialPubEncryptionKey.encode('hex') ripe = hashlib.new('ripemd160') sha = hashlib.new('sha512') sha.update( potentialPubSigningKey + potentialPubEncryptionKey) ripe.update(sha.digest()) - # print 'potential ripe.digest', - # ripe.digest().encode('hex') if ripe.digest()[:numberOfNullBytesDemandedOnFrontOfRipeHash] == '\x00' * numberOfNullBytesDemandedOnFrontOfRipeHash: break - print 'Generated address with ripe digest:', ripe.digest().encode('hex') - print 'Address generator calculated', numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix, 'addresses at', numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix / (time.time() - startTime), 'addresses per second before finding one with the correct ripe-prefix.' + logger.info('Generated address with ripe digest: %s' % ripe.digest().encode('hex')) + try: + logger.info('Address generator calculated %s addresses at %s addresses per second before finding one with the correct ripe-prefix.' % (numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix, numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix / (time.time() - startTime))) + except ZeroDivisionError: + # The user must have a pretty fast computer. time.time() - startTime equaled zero. + pass address = encodeAddress(addressVersionNumber, streamNumber, ripe.digest()) # An excellent way for us to store our keys is in Wallet Import Format. Let us convert now. @@ -108,14 +108,12 @@ class addressGenerator(threading.Thread): privSigningKey).digest()).digest()[0:4] privSigningKeyWIF = arithmetic.changebase( privSigningKey + checksum, 256, 58) - # print 'privSigningKeyWIF',privSigningKeyWIF privEncryptionKey = '\x80' + potentialPrivEncryptionKey checksum = hashlib.sha256(hashlib.sha256( privEncryptionKey).digest()).digest()[0:4] privEncryptionKeyWIF = arithmetic.changebase( privEncryptionKey + checksum, 256, 58) - # print 'privEncryptionKeyWIF',privEncryptionKeyWIF shared.config.add_section(address) shared.config.set(address, 'label', label) @@ -178,9 +176,6 @@ class addressGenerator(threading.Thread): potentialPrivSigningKey) potentialPubEncryptionKey = highlevelcrypto.pointMult( potentialPrivEncryptionKey) - # print 'potentialPubSigningKey', potentialPubSigningKey.encode('hex') - # print 'potentialPubEncryptionKey', - # potentialPubEncryptionKey.encode('hex') signingKeyNonce += 2 encryptionKeyNonce += 2 ripe = hashlib.new('ripemd160') @@ -188,13 +183,16 @@ class addressGenerator(threading.Thread): sha.update( potentialPubSigningKey + potentialPubEncryptionKey) ripe.update(sha.digest()) - # print 'potential ripe.digest', - # ripe.digest().encode('hex') if ripe.digest()[:numberOfNullBytesDemandedOnFrontOfRipeHash] == '\x00' * numberOfNullBytesDemandedOnFrontOfRipeHash: break - print 'ripe.digest', ripe.digest().encode('hex') - print 'Address generator calculated', numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix, 'addresses at', numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix / (time.time() - startTime), 'keys per second.' + + logger.info('Generated address with ripe digest: %s' % ripe.digest().encode('hex')) + try: + logger.info('Address generator calculated %s addresses at %s addresses per second before finding one with the correct ripe-prefix.' % (numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix, numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix / (time.time() - startTime))) + except ZeroDivisionError: + # The user must have a pretty fast computer. time.time() - startTime equaled zero. + pass address = encodeAddress(addressVersionNumber, streamNumber, ripe.digest()) saveAddressToDisk = True @@ -222,14 +220,19 @@ class addressGenerator(threading.Thread): privEncryptionKeyWIF = arithmetic.changebase( privEncryptionKey + checksum, 256, 58) - addressAlreadyExists = False + try: shared.config.add_section(address) + addressAlreadyExists = False except: - print address, 'already exists. Not adding it again.' addressAlreadyExists = True - if not addressAlreadyExists: - print 'label:', label + + if addressAlreadyExists: + logger.info('%s already exists. Not adding it again.' % address) + shared.UISignalQueue.put(( + 'updateStatusBar', tr.translateText("MainWindow","%1 is already in 'Your Identities'. Not adding it again.").arg(address))) + else: + logger.debug('label: %s' % label) shared.config.set(address, 'label', label) shared.config.set(address, 'enabled', 'true') shared.config.set(address, 'decoy', 'false') @@ -262,18 +265,16 @@ class addressGenerator(threading.Thread): elif addressVersionNumber == 4: shared.workerQueue.put(( 'sendOutOrStoreMyV4Pubkey', address)) + shared.UISignalQueue.put(( + 'updateStatusBar', tr.translateText("MainWindow", "Done generating address"))) # Done generating addresses. if command == 'createDeterministicAddresses' or command == 'joinChan' or command == 'createChan': shared.apiAddressGeneratorReturnQueue.put( listOfNewAddressesToSendOutThroughTheAPI) - shared.UISignalQueue.put(( - 'updateStatusBar', tr.translateText("MainWindow", "Done generating address"))) - # shared.reloadMyAddressHashes() elif command == 'getDeterministicAddress': shared.apiAddressGeneratorReturnQueue.put(address) - #todo: return things to the API if createChan or joinChan assuming saveAddressToDisk else: raise Exception( "Error in the addressGenerator thread. Thread was given a command it could not understand: " + command) diff --git a/src/translations/bitmessage_nl.ts b/src/translations/bitmessage_nl.ts index 54237fdd..654d993a 100644 --- a/src/translations/bitmessage_nl.ts +++ b/src/translations/bitmessage_nl.ts @@ -44,7 +44,7 @@ View HTML code as formatted text - Bekijk HTML als geformatteerde tekst + @@ -84,7 +84,7 @@ Send message to this address - Stuur bericht naar dit adres + @@ -94,7 +94,7 @@ Add New Address - Nieuw adres toevoegen + @@ -104,7 +104,7 @@ Copy destination address to clipboard - Kopieer bestemmingsadres naar klembord + @@ -139,7 +139,7 @@ Message sent. Waiting for acknowledgement. Sent at %1 - Bericht verzonden. Wachten op bevestiging. Verzonden op %1 + @@ -154,7 +154,7 @@ Acknowledgement of the message received %1 - Bevestiging van het bericht ontvangen op %1 + @@ -184,7 +184,7 @@ Unknown status: %1 %2 - Status onbekend: %1 %2 + @@ -204,7 +204,7 @@ Subscribe - Abonneer + @@ -231,7 +231,7 @@ It is important that you back up this file. Open keys.dat? - keys.dat openen? + @@ -288,7 +288,7 @@ It is important that you back up this file. Would you like to open the file now? Success - Gelukt + @@ -298,7 +298,7 @@ It is important that you back up this file. Would you like to open the file now? Address too new - Adres te nieuw + @@ -313,7 +313,7 @@ It is important that you back up this file. Would you like to open the file now? That Bitmessage address is not valid. - Dat Bitmessage adres is niet geldig. + @@ -333,17 +333,17 @@ It is important that you back up this file. Would you like to open the file now? Processed %1 person-to-person messages. - Verwerkt %1 peer-to-peer-bericht(en). + Processed %1 broadcast messages. - Verwerkt %1 broadcast-bericht(en). + Processed %1 public keys. - Verwerkt %1 publieke sleutel(s). + @@ -408,7 +408,7 @@ It is important that you back up this file. Would you like to open the file now? Address version number - Adres versienummer + @@ -458,7 +458,7 @@ It is important that you back up this file. Would you like to open the file now? From - Van + Van @@ -468,7 +468,7 @@ It is important that you back up this file. Would you like to open the file now? The address you entered was invalid. Ignoring it. - Het ingevoerd adres is ongeldig. Worden genegeerd. + @@ -568,7 +568,7 @@ It is important that you back up this file. Would you like to open the file now? No addresses selected. - Geen adressen geselecteerd. + Geen adressen geselecteerd @@ -733,7 +733,7 @@ It is important that you back up this file. Would you like to open the file now? Your Identities - Uw identiteiten + Je identiteiten @@ -803,22 +803,22 @@ It is important that you back up this file. Would you like to open the file now? Processed 0 person-to-person message. - Verwerkt 0 peer-to-peer-bericht. + Processed 0 public key. - Verwerkt 0 broadcast-bericht. + Processed 0 broadcast. - Verwerkt 0 publieke sleutel. + Network Status - netwerkstatus + @@ -848,7 +848,7 @@ It is important that you back up this file. Would you like to open the file now? Ctrl+Q - Ctrl+Q + Ctrrl+Q @@ -883,7 +883,7 @@ It is important that you back up this file. Would you like to open the file now? Bad address version number - Slechte adres versienummer + @@ -1150,7 +1150,7 @@ The 'Random Number' option is selected by default but deterministic ad About - Over + @@ -1173,7 +1173,7 @@ The 'Random Number' option is selected by default but deterministic ad Bitmessage - Bitmessage + @@ -1528,7 +1528,7 @@ The 'Random Number' option is selected by default but deterministic ad Password: - Wachtwoord + @@ -1563,7 +1563,7 @@ The 'Random Number' option is selected by default but deterministic ad Interface Language - Interface Taal + @@ -1633,22 +1633,22 @@ The 'Random Number' option is selected by default but deterministic ad Give up after - Opgeven na + and - en + days - dagen + months. - maanden. +