txbatcher: add_info_from_wallet in _new_base_tx
37.23 | E | txbatcher.TxBatch | TxBatch error: AttributeError("'TxOutput' object has no attribute 'is_change'")
Traceback (most recent call last):
File "/opt/electrum/electrum/txbatcher.py", line 248, in run
await self.run_iteration()
File "/opt/electrum/electrum/txbatcher.py", line 379, in run_iteration
base_tx = self.find_base_tx()
File "/opt/electrum/electrum/txbatcher.py", line 369, in find_base_tx
self._new_base_tx(tx)
File "/opt/electrum/electrum/json_db.py", line 48, in wrapper
return func(self, *args, **kwargs)
File "/opt/electrum/electrum/txbatcher.py", line 518, in _new_base_tx
if tx.has_change():
File "/opt/electrum/electrum/transaction.py", line 1276, in has_change
return len(self.get_change_outputs()) > 0
File "/opt/electrum/electrum/transaction.py", line 1273, in get_change_outputs
return [o for o in self._outputs if o.is_change]
File "/opt/electrum/electrum/transaction.py", line 1273, in <listcomp>
return [o for o in self._outputs if o.is_change]
AttributeError: 'TxOutput' object has no attribute 'is_change'
This commit is contained in:
@@ -515,6 +515,8 @@ class TxBatch(Logger):
|
||||
def _new_base_tx(self, tx: Transaction):
|
||||
self._prevout = tx.inputs()[0].prevout.to_str()
|
||||
self.storage['prevout'] = self._prevout
|
||||
tx = PartialTransaction.from_tx(tx)
|
||||
tx.add_info_from_wallet(self.wallet) # this sets is_change
|
||||
if tx.has_change():
|
||||
self._batch_txids.append(tx.txid())
|
||||
self._base_tx = tx
|
||||
|
||||
Reference in New Issue
Block a user