Fix mixmate and sneakernet

This commit is contained in:
Kevin Froman 2020-10-14 00:07:41 +00:00
parent 2291d5a5f2
commit e0f59784b1
4 changed files with 19 additions and 6 deletions

View file

@ -21,7 +21,7 @@ import deadsimplekv as simplekv
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
inbox_cache = {}
def load_inbox():
inbox_list = []
deleted = simplekv.DeadSimpleKV(identifyhome.identify_home() + '/mailcache.dat').get('deleted_mail')
@ -29,8 +29,14 @@ def load_inbox():
deleted = []
for blockHash in blockmetadb.get_blocks_by_type('pm'):
if blockHash in deleted:
continue
if blockHash in inbox_cache:
inbox_list.append(blockHash)
continue
block = onionrblockapi.Block(blockHash)
block.decrypt()
if block.decrypted and reconstructhash.deconstruct_hash(blockHash) not in deleted:
if block.decrypted and reconstructhash.deconstruct_hash(blockHash):
inbox_cache[blockHash] = True
inbox_list.append(blockHash)
return inbox_list