@@ -172,9 +172,6 @@ def get_txin_value(self, txin: TxInput, *, address: str = None) -> Optional[int]
172172 return tx .outputs ()[prevout_n ].value
173173 return None
174174
175- def get_txout_address (self , txo : TxOutput ) -> Optional [str ]:
176- return txo .address
177-
178175 def load_unverified_transactions (self ):
179176 # review transactions that are in the history
180177 for addr in self .db .get_history ():
@@ -271,7 +268,7 @@ def add_transaction(self, tx: Transaction, *, allow_unrelated=False) -> bool:
271268 # it could happen that we think tx is unrelated but actually one of the inputs is is_mine.
272269 # this is the main motivation for allow_unrelated
273270 is_mine = any ([self .is_mine (self .get_txin_address (txin )) for txin in tx .inputs ()])
274- is_for_me = any ([self .is_mine (self . get_txout_address ( txo ) ) for txo in tx .outputs ()])
271+ is_for_me = any ([self .is_mine (txo . address ) for txo in tx .outputs ()])
275272 if not is_mine and not is_for_me :
276273 raise UnrelatedTransactionException ()
277274 # Find all conflicting transactions.
@@ -325,7 +322,7 @@ def add_value_from_prev_output():
325322 ser = tx_hash + ':%d' % n
326323 scripthash = bitcoin .script_to_scripthash (txo .scriptpubkey .hex ())
327324 self .db .add_prevout_by_scripthash (scripthash , prevout = TxOutpoint .from_str (ser ), value = v )
328- addr = self . get_txout_address ( txo )
325+ addr = txo . address
329326 if addr and self .is_mine (addr ):
330327 self .db .add_txo_addr (tx_hash , addr , n , v , is_coinbase )
331328 self ._get_addr_balance_cache .pop (addr , None ) # invalidate cache
0 commit comments