txbatcher: add comment to _to_pay_after
This commit is contained in:
@@ -1069,7 +1069,7 @@ class Network(Logger, NetworkRetryManager[ServerAddr]):
|
|||||||
raise RequestTimedOut()
|
raise RequestTimedOut()
|
||||||
await self.interface.broadcast_transaction(tx, timeout=timeout)
|
await self.interface.broadcast_transaction(tx, timeout=timeout)
|
||||||
|
|
||||||
async def try_broadcasting(self, tx, name) -> bool:
|
async def try_broadcasting(self, tx: 'Transaction', name: str) -> bool:
|
||||||
try:
|
try:
|
||||||
await self.broadcast_transaction(tx)
|
await self.broadcast_transaction(tx)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -203,6 +203,9 @@ class TxOutput:
|
|||||||
def __ne__(self, other):
|
def __ne__(self, other):
|
||||||
return not (self == other)
|
return not (self == other)
|
||||||
|
|
||||||
|
def __hash__(self) -> int:
|
||||||
|
return hash((self.scriptpubkey, self.value))
|
||||||
|
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
d = {
|
d = {
|
||||||
'scriptpubkey': self.scriptpubkey.hex(),
|
'scriptpubkey': self.scriptpubkey.hex(),
|
||||||
|
|||||||
@@ -303,6 +303,8 @@ class TxBatch(Logger):
|
|||||||
def _to_pay_after(self, tx: Optional[PartialTransaction]) -> Sequence[PartialTxOutput]:
|
def _to_pay_after(self, tx: Optional[PartialTransaction]) -> Sequence[PartialTxOutput]:
|
||||||
if not tx:
|
if not tx:
|
||||||
return self.batch_payments
|
return self.batch_payments
|
||||||
|
# note: the below is equivalent to
|
||||||
|
# to_pay = multiset(self.batch_payments) - multiset(tx.outputs())
|
||||||
to_pay = []
|
to_pay = []
|
||||||
outputs = copy.deepcopy(tx.outputs())
|
outputs = copy.deepcopy(tx.outputs())
|
||||||
for x in self.batch_payments:
|
for x in self.batch_payments:
|
||||||
|
|||||||
Reference in New Issue
Block a user