Browse Source

addr_sync.set_future_tx: clarify wanted_height off-by-one semantics

master
SomberNight 3 years ago
parent
commit
9097d5e43d
No known key found for this signature in database
GPG Key ID: B33B5F232C6271E9
  1. 7
      electrum/address_synchronizer.py

7
electrum/address_synchronizer.py

@ -656,8 +656,11 @@ class AddressSynchronizer(Logger, EventListener):
return self.network.get_local_height() if self.network else self.db.get('stored_height', 0)
def set_future_tx(self, txid: str, *, wanted_height: int):
# note: wanted_height is always an absolute height, even in case of CSV-locked txs.
# In case of a CSV-locked tx with unconfirmed inputs, the wanted_height is a best-case guess.
"""Mark a local tx as "future" (encumbered by a timelock).
wanted_height is the min (abs) block height at which the tx can get into the mempool (be broadcast).
note: tx becomes consensus-valid to be mined in a block at height wanted_height+1
In case of a CSV-locked tx with unconfirmed inputs, the wanted_height is a best-case guess.
"""
with self.lock:
self.future_tx[txid] = wanted_height

Loading…
Cancel
Save