From 7f06cb7c2772a2e6d762163d12ae558946b4ee4a Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sat, 10 Jun 2017 10:10:59 +0200 Subject: [PATCH] Inventory flush fix in GUI - Fixes #1011 --- src/bitmessageqt/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index 76f6e46d..9f4f0b04 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -77,7 +77,7 @@ from class_objectHashHolder import objectHashHolder from class_singleWorker import singleWorker from dialogs import AddAddressDialog from helper_generic import powQueueSize -from inventory import PendingDownloadQueue, PendingUpload, PendingUploadDeadlineException +from inventory import Inventory, PendingDownloadQueue, PendingUpload, PendingUploadDeadlineException import knownnodes import paths from proofofwork import getPowType @@ -2324,11 +2324,11 @@ class MyForm(settingsmixin.SMainWindow): # in the objectProcessorQueue to be processed if self.NewSubscriptionDialogInstance.ui.checkBoxDisplayMessagesAlreadyInInventory.isChecked(): status, addressVersion, streamNumber, ripe = decodeAddress(address) - shared.inventory.flush() + Inventory().flush() doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint( addressVersion) + encodeVarint(streamNumber) + ripe).digest()).digest() tag = doubleHashOfAddressData[32:] - for value in shared.inventory.by_type_and_tag(3, tag): + for value in Inventory().by_type_and_tag(3, tag): queues.objectProcessorQueue.put((value.type, value.payload)) def click_pushButtonStatusIcon(self): @@ -4398,11 +4398,11 @@ class NewSubscriptionDialog(QtGui.QDialog): self.ui.checkBoxDisplayMessagesAlreadyInInventory.setText( _translate("MainWindow", "Address is an old type. We cannot display its past broadcasts.")) else: - shared.inventory.flush() + Inventory().flush() doubleHashOfAddressData = hashlib.sha512(hashlib.sha512(encodeVarint( addressVersion) + encodeVarint(streamNumber) + ripe).digest()).digest() tag = doubleHashOfAddressData[32:] - count = len(shared.inventory.by_type_and_tag(3, tag)) + count = len(Inventory().by_type_and_tag(3, tag)) if count == 0: self.ui.checkBoxDisplayMessagesAlreadyInInventory.setText( _translate("MainWindow", "There are no recent broadcasts from this address to display."))