File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5656import bitmessage_icons_rc # noqa:F401 pylint: disable=unused-import
5757import helper_sent
5858
59- from six .moves import iteritems , itervalues , range as xrange
60- from six import text_type
59+ from six import iteritems , itervalues , text_type
6160
6261try :
6362 from plugins .plugin import get_plugin , get_plugins
Original file line number Diff line number Diff line change @@ -141,15 +141,19 @@ def checkackdata(data):
141141 # bypass nonce and time, retain object type/version/stream + body
142142 readPosition = 16
143143
144- if data [readPosition :] in state .ackdataForWhichImWatching :
144+ # data may be a memoryview, which is not hashable and thus
145+ # cannot be used as a dictionary key; convert the slice to bytes.
146+ ackcheckdata = bytes (data [readPosition :])
147+
148+ if ackcheckdata in state .ackdataForWhichImWatching :
145149 logger .info ('This object is an acknowledgement bound for me.' )
146- del state .ackdataForWhichImWatching [data [ readPosition :] ]
150+ del state .ackdataForWhichImWatching [ackcheckdata ]
147151 sqlExecute (
148152 "UPDATE sent SET status='ackreceived', lastactiontime=?"
149- " WHERE ackdata=?" , int (time .time ()), data [ readPosition :] )
153+ " WHERE ackdata=?" , int (time .time ()), ackcheckdata )
150154 queues .UISignalQueue .put ((
151155 'updateSentItemStatusByAckdata' , (
152- data [ readPosition :] ,
156+ ackcheckdata ,
153157 _translate (
154158 "MainWindow" ,
155159 "Acknowledgement of the message received %1"
You can’t perform that action at this time.
0 commit comments