Browse Source

add comment to guess_txintype_from_address

3.2.x
SomberNight 7 years ago
parent
commit
174d14ba89
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 9
      lib/transaction.py

9
lib/transaction.py

@ -844,6 +844,15 @@ class Transaction:
@classmethod
def guess_txintype_from_address(cls, addr):
# It's not possible to tell the script type in general
# just from an address.
# - "1" addresses are of course p2pkh
# - "3" addresses are p2sh but we don't know the redeem script..
# - "bc1" addresses (if they are 42-long) are p2wpkh
# - "bc1" addresses that are 62-long are p2wsh but we don't know the script..
# If we don't know the script, we _guess_ it is pubkeyhash.
# As this method is used e.g. for tx size estimation,
# the estimation will not be precise.
witver, witprog = segwit_addr.decode(constants.net.SEGWIT_HRP, addr)
if witprog is not None:
return 'p2wpkh'

Loading…
Cancel
Save