1
0

bump fee of swap claim transactions

Note: This adds a new field, spent_txid, to PartialTxOutput
This commit is contained in:
ThomasV
2022-03-19 09:36:50 +01:00
parent 4dd94172a6
commit 1364e7538a
4 changed files with 52 additions and 22 deletions

View File

@@ -761,10 +761,9 @@ class AddressSynchronizer(Logger):
for tx_hash, height in h:
l = self.db.get_txi_addr(tx_hash, address)
for txi, v in l:
sent[txi] = height
sent[txi] = tx_hash, height
return received, sent
def get_addr_outputs(self, address: str) -> Dict[TxOutpoint, PartialTxInput]:
coins, spent = self.get_addr_io(address)
out = {}
@@ -775,7 +774,13 @@ class AddressSynchronizer(Logger):
utxo._trusted_address = address
utxo._trusted_value_sats = value
utxo.block_height = tx_height
utxo.spent_height = spent.get(prevout_str, None)
if prevout_str in spent:
txid, height = spent[prevout_str]
utxo.spent_txid = txid
utxo.spent_height = height
else:
utxo.spent_txid = None
utxo.spent_height = None
out[prevout] = utxo
return out
@@ -816,7 +821,8 @@ class AddressSynchronizer(Logger):
else:
u += v
if txo in sent:
if sent[txo] > 0:
sent_txid, sent_height = sent[txo]
if sent_height > 0:
c -= v
else:
u -= v