diff --git a/lib/transaction.py b/lib/transaction.py index b9ad97a4a..230aca0e6 100644 --- a/lib/transaction.py +++ b/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'