def parse_fallback(fallback, net: Type[AbstractNet]):
    wver = fallback[0:5].uint
    if (wver == 17):
        addr = hash160_to_b58_address(fallback[5:].tobytes(), net.ADDRTYPE_P2PKH)
    elif (wver == 18):
        addr = hash160_to_b58_address(fallback[5:].tobytes(), net.ADDRTYPE_P2SH)
    elif (wver <= 16):
        witprog = fallback[5:]
        witprog = witprog[:((len(witprog) // 8) * 8)]
        witprog = witprog.tobytes()
        addr = segwit_addr.encode_segwit_address(net.SEGWIT_HRP, wver, witprog)
    else:
        return None
    return addr
def parse_fallback(fallback, net: Type[AbstractNet]):
    wver = fallback[0:5].uint
    if (wver == 17):
        addr = hash160_to_b58_address(fallback[5:].tobytes(), net.ADDRTYPE_P2PKH)
    elif (wver == 18):
        addr = hash160_to_b58_address(fallback[5:].tobytes(), net.ADDRTYPE_P2SH)
    elif (wver <= 16):
        witprog = fallback[5:]
        witprog = witprog[:((len(witprog) // 8) * 8)]
        witprog = witprog.tobytes()
        addr = segwit_addr.encode_segwit_address(net.SEGWIT_HRP, wver, witprog)
    else:
        return None
    return addr