sqlExecute('''UPDATE sent SET msgid=?, status=?, retrynumber=?, sleeptill=?, lastactiontime=? WHERE ackdata=?''',
inventoryHash,
newStatus,
@ -896,9 +892,9 @@ class singleWorker(threading.Thread, StoppableThread):
iftagnotinstate.neededPubkeys:
state.neededPubkeys[tag]=(toAddress,highlevelcrypto.makeCryptor(hexlify(privEncryptionKey)))# We'll need this for when we receive a pubkey reply: it will be encrypted and we'll need to decrypt it.
ifretryNumber==0:
TTL=2.5*24*60*60# 2.5 days. This was chosen fairly arbitrarily.
else:
TTL=2.5*24*60*60# 2.5 days. This was chosen fairly arbitrarily.
TTL*=2**retryNumber
if TTL>28*24*60*60:
TTL=28*24*60*60
TTL=TTL+random.randrange(-300,300)# add some randomness to the TTL
embeddedTime=int(time.time()+TTL)
@ -934,10 +930,8 @@ class singleWorker(threading.Thread, StoppableThread):
'''UPDATE sent SET lastactiontime=?, status='awaitingpubkey', retrynumber=?, sleeptill=? WHERE toaddress=? AND (status='doingpubkeypow' OR status='awaitingpubkey') ''',