dimanche 13 septembre 2020

IndentationError: expected an indented block cannot loop script [duplicate]

I am trying to make a loop so that the script generates hash constantly

from bitcoin import *
import os
import hashlib
import base58

while True:
    priv =  random_key()
    pubkey = privtopub(priv)
    compress_pubkey = False
    
 
    if (compress_pubkey):
    if (ord(pubkey[-2:].decode('hex')) % 2 == 0):
        pubkey_compressed = '02'
    else:
        pubkey_compressed = '03'
    pubkey_compressed += pubkey[2:66]
    hex_str = bytearray.fromhex(pubkey_compressed)
    else:
        hex_str = bytearray.fromhex(pubkey)
 
key_hash = hash160(hex_str)

I am using Python 3 and I am getting the error:

    if (ord(pubkey[-2:].decode('hex')) % 2 == 0):
     ^
IndentationError: expected an indented block



Aucun commentaire:

Enregistrer un commentaire