mirror of
https://github.com/bitcoinbook/bitcoinbook
synced 2024-11-28 19:08:22 +00:00
whitespace fixes to placate flake8
This commit is contained in:
parent
6c980afdd0
commit
ecd13d3523
@ -8,7 +8,7 @@ address = '1Dorian4RoXcnBv9hnQ4Y2C1an6NJ4UrjX'
|
||||
|
||||
# The API URL is https://blockchain.info/unspent?active=<address>
|
||||
# It returns a JSON object with a list "unspent_outputs", containing UTXO, like this:
|
||||
#{ "unspent_outputs":[
|
||||
# { "unspent_outputs":[
|
||||
# {
|
||||
# "tx_hash":"ebadfaa92f1fd29e2fe296eda702c48bd11ffd52313e986e99ddad9084062167",
|
||||
# "tx_index":51919767,
|
||||
@ -19,7 +19,7 @@ address = '1Dorian4RoXcnBv9hnQ4Y2C1an6NJ4UrjX'
|
||||
# "confirmations":28691
|
||||
# },
|
||||
# ...
|
||||
#]}
|
||||
# ]}
|
||||
|
||||
resp = requests.get('https://blockchain.info/unspent?active=%s' % address)
|
||||
utxo_set = json.loads(resp.text)["unspent_outputs"]
|
||||
|
@ -15,4 +15,4 @@ for nonce in range(20):
|
||||
hash_data = hashlib.sha256(input_data).hexdigest()
|
||||
|
||||
# show the input and hash result
|
||||
print(input_data, '=>', hash_data)
|
||||
print(input_data, '=>', hash_data)
|
||||
|
@ -8,6 +8,7 @@ from pycoin.key.validate import is_address_valid, is_wif_valid
|
||||
from pycoin.services import spendables_for_address
|
||||
from pycoin.tx.tx_utils import create_signed_tx
|
||||
|
||||
|
||||
def get_address(which):
|
||||
while 1:
|
||||
print("enter the %s address=> " % which, end='')
|
||||
@ -17,6 +18,7 @@ def get_address(which):
|
||||
return address
|
||||
print("invalid address, please try again")
|
||||
|
||||
|
||||
src_address = get_address("source")
|
||||
spendables = spendables_for_address(src_address)
|
||||
print(spendables)
|
||||
|
@ -32,6 +32,3 @@ for txid in transactions:
|
||||
block_value = block_value + tx_value
|
||||
|
||||
print("Total value in block: ", block_value)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user