A couple more tweaks.
This commit is contained in:
parent
6deb05ab6f
commit
f02acdfd46
@ -5,6 +5,9 @@ account in the code.
|
|||||||
or lists with tuple(), list(). Of those list is 10% faster than
|
or lists with tuple(), list(). Of those list is 10% faster than
|
||||||
tuple.
|
tuple.
|
||||||
|
|
||||||
|
- however when not initializing from a generator, a fixed-length tuple
|
||||||
|
is at least 80% faster than a list.
|
||||||
|
|
||||||
- an implicit default argument is ~5% faster than passing the default
|
- an implicit default argument is ~5% faster than passing the default
|
||||||
explicitly
|
explicitly
|
||||||
|
|
||||||
|
|||||||
@ -211,8 +211,8 @@ class MemPool(LoggedClass):
|
|||||||
return (script_hash168(txout.pk_script), txout.value)
|
return (script_hash168(txout.pk_script), txout.value)
|
||||||
|
|
||||||
for hex_hash, tx in new_txs.items():
|
for hex_hash, tx in new_txs.items():
|
||||||
txout_pairs = tuple(txout_pair(txout) for txout in tx.outputs)
|
txout_pairs = [txout_pair(txout) for txout in tx.outputs]
|
||||||
self.txs[hex_hash] = [None, txout_pairs, None]
|
self.txs[hex_hash] = (None, txout_pairs, None)
|
||||||
|
|
||||||
def txin_info(txin):
|
def txin_info(txin):
|
||||||
hex_hash = hash_to_str(txin.prev_hash)
|
hex_hash = hash_to_str(txin.prev_hash)
|
||||||
@ -239,7 +239,7 @@ class MemPool(LoggedClass):
|
|||||||
# If we were missing a UTXO for some reason drop this tx
|
# If we were missing a UTXO for some reason drop this tx
|
||||||
del self.txs[hex_hash]
|
del self.txs[hex_hash]
|
||||||
continue
|
continue
|
||||||
self.txs[hex_hash] = [txin_pairs, txout_pairs, any(unconfs)]
|
self.txs[hex_hash] = (txin_pairs, txout_pairs, any(unconfs))
|
||||||
|
|
||||||
# Update touched and self.hash168s for the new tx
|
# Update touched and self.hash168s for the new tx
|
||||||
for hash168, value in txin_pairs:
|
for hash168, value in txin_pairs:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user