SHARE
TWEET

Untitled

a guest Aug 18th, 2019 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. """
  2. Get addresses (and corresponding private keys) from a remote resource
  3. (directory.io) and check if they have a non-zero balance using remote resources
  4. (blockr.io, blockonomics.co etc.). If a non-zero balance address is found,
  5. it is printed on screen, saved to a file, and a pushbullet notification is
  6. sent.
  7. """
  8. import sys
  9. import time
  10. import traceback
  11.  
  12. from bcsearch.addresses import get_addresses_directoryio
  13. from bcsearch.balances import get_balances_bitcoind,_get_balance
  14. from bcsearch.utils import pb_notify
  15.  
  16. while True:
  17.     try:
  18.         print("==== Start ====")
  19.  
  20.         addresses_dict = get_addresses_directoryio()
  21.         if addresses_dict is None:
  22.             print("* directory.io is unreachable!")
  23.             time.sleep(10)
  24.             continue
  25.  
  26.         addresses = list(addresses_dict.keys())
  27.  
  28.         balances = _get_balance(addresses)
  29.         if balances is None:
  30.             print("* No balances could be obtained!")
  31.             time.sleep(10)
  32.             continue
  33.  
  34.         for addr, balance in balances.items():
  35.             if balance != 0:
  36.                 privkey = addresses_dict[addr]
  37.                 print(balance, addr, privkey)
  38.  
  39.                 with open("remote_found_balances", "a") as fp:
  40.                     fp.write(str(balance) + " " + addr + " " + privkey + "\n")
  41.  
  42.                 pb_notify("FOUND" + str(balance) + "!",
  43.                           addr + " : " + privkey)
  44.  
  45.         print("==== End ====")
  46.  
  47.     except Exception:
  48.         # Catch everything except KeyboardIterrupt and SystemExit
  49.         traceback.print_exc()
  50.         pb_notify('Exception in remote runner: Quitting', '')
  51.         sys.exit(1)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top