remove ismempool flag
This commit is contained in:
parent
56014643a1
commit
df689325a6
|
@ -20,6 +20,8 @@ Todo:
|
||||||
* server should check and return bitcoind status..
|
* server should check and return bitcoind status..
|
||||||
* improve txpoint sorting
|
* improve txpoint sorting
|
||||||
* command to check cache
|
* command to check cache
|
||||||
|
|
||||||
|
mempool transactions do not need to be added to the database; it slows it down
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,14 +75,14 @@ class MyStore(Datastore_class):
|
||||||
_hash = store.binout(row[6])
|
_hash = store.binout(row[6])
|
||||||
address = hash_to_address(chr(0), _hash)
|
address = hash_to_address(chr(0), _hash)
|
||||||
if self.tx_cache.has_key(address):
|
if self.tx_cache.has_key(address):
|
||||||
print "cache: invalidating", address, self.ismempool
|
#print "cache: invalidating", address
|
||||||
self.tx_cache.pop(address)
|
self.tx_cache.pop(address)
|
||||||
outrows = self.get_tx_outputs(txid, False)
|
outrows = self.get_tx_outputs(txid, False)
|
||||||
for row in outrows:
|
for row in outrows:
|
||||||
_hash = store.binout(row[6])
|
_hash = store.binout(row[6])
|
||||||
address = hash_to_address(chr(0), _hash)
|
address = hash_to_address(chr(0), _hash)
|
||||||
if self.tx_cache.has_key(address):
|
if self.tx_cache.has_key(address):
|
||||||
print "cache: invalidating", address, self.ismempool
|
#print "cache: invalidating", address
|
||||||
self.tx_cache.pop(address)
|
self.tx_cache.pop(address)
|
||||||
|
|
||||||
def safe_sql(self,sql, params=(), lock=True):
|
def safe_sql(self,sql, params=(), lock=True):
|
||||||
|
@ -623,7 +625,6 @@ if __name__ == '__main__':
|
||||||
args.connect_args = { 'database' : config.get('database','database') }
|
args.connect_args = { 'database' : config.get('database','database') }
|
||||||
store = MyStore(args)
|
store = MyStore(args)
|
||||||
store.tx_cache = {}
|
store.tx_cache = {}
|
||||||
store.ismempool = False
|
|
||||||
store.mempool_keys = {}
|
store.mempool_keys = {}
|
||||||
|
|
||||||
thread.start_new_thread(listen_thread, (store,))
|
thread.start_new_thread(listen_thread, (store,))
|
||||||
|
@ -635,9 +636,7 @@ if __name__ == '__main__':
|
||||||
try:
|
try:
|
||||||
dblock.acquire()
|
dblock.acquire()
|
||||||
store.catch_up()
|
store.catch_up()
|
||||||
store.ismempool = True
|
|
||||||
memorypool_update(store)
|
memorypool_update(store)
|
||||||
store.ismempool = False
|
|
||||||
block_number = store.get_block_number(1)
|
block_number = store.get_block_number(1)
|
||||||
dblock.release()
|
dblock.release()
|
||||||
except:
|
except:
|
||||||
|
|
Loading…
Reference in New Issue