Browse Source

addr_sync: expand docstring for get_tx_fee

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

9
electrum/address_synchronizer.py

@ -742,7 +742,14 @@ class AddressSynchronizer(Logger, EventListener):
return delta
def get_tx_fee(self, txid: str) -> Optional[int]:
""" Returns tx_fee or None. Use server fee only if tx is unconfirmed and not mine"""
"""Returns tx_fee or None. Use server fee only if tx is unconfirmed and not mine.
Note: being fast is prioritised over completeness here. We try to avoid deserializing
the tx, as that is expensive if we are called for the whole history. We sometimes
incorrectly early-exit and return None, e.g. for not-all-ismine-input txs,
where we could calculate the fee if we deserialized (but to see if we have all
the parent txs available, we would have to deserialize first).
"""
# check if stored fee is available
fee = self.db.get_tx_fee(txid, trust_server=False)
if fee is not None:

Loading…
Cancel
Save