_hash = store.binout(row[6])
address = hash_to_address(chr(0), _hash)
if self.tx_cache.has_key(address):
- #print "cache: invalidating", address
+ print "cache: invalidating", address
self.tx_cache.pop(address)
outrows = self.get_tx_outputs(txid, False)
for row in outrows:
_hash = store.binout(row[6])
address = hash_to_address(chr(0), _hash)
if self.tx_cache.has_key(address):
- #print "cache: invalidating", address
+ print "cache: invalidating", address
self.tx_cache.pop(address)
def safe_sql(self,sql, params=(), lock=True):
tx_hash = self.hashout_hex(tx_hash)
if tx_hash in known_tx:
continue
+
+ # this means that pending transactions were added to the db, even if they are not returned by getmemorypool
+ address_has_mempool = True
+
+ # this means pending transactions are returned by getmemorypool
if tx_hash not in self.mempool_keys:
continue
- address_has_mempool = True
#print "mempool", tx_hash
txpoint = {
"nTime": 0,
try:
cmd, data = ast.literal_eval(msg[:-1])
except:
- print "syntax error", repr(msg)
+ print "syntax error", repr(msg), ipaddr
conn.close()
return
elif cmd =='clear_cache':
if config.get('server','password') == data:
- self.tx_cache = {}
+ store.tx_cache = {}
out = 'ok'
else:
out = 'wrong password'
ds.write(hextx.decode('hex'))
tx = deserialize.parse_Transaction(ds)
tx['hash'] = util.double_sha256(tx['tx'])
- store.mempool_keys.append(tx['hash'][::-1].encode('hex'))
+ tx_hash = tx['hash'][::-1].encode('hex')
+ store.mempool_keys.append(tx_hash)
if store.tx_find_id_and_value(tx):
pass
- else:
+ else:
store.import_tx(tx, False)
store.commit()