Skip to content

Instantly share code, notes, and snippets.

from hashlib import sha256
import random
def duplicates_for_shortid(txidsize, mempoolsize_mb=32, mempoolsize_kb=None):
if mempoolsize_kb:
n = int(mempoolsize_kb * 1024.0 / 266)
else:
n = int(mempoolsize_mb * 1024.0 * 1024.0 / 266)
txids = set()
#!/usr/bin/env python
import json, cStringIO, traceback, sys, os, urllib2, random, time
blockfilename = '000000000000000001c37467f0843dd9e09536c21938c5c20551191788a70541'
mempoolfilenames = ['00000000000000000008658cdaba34569f00748085df3923cb5287e55a2fe27c',
'000000000000000000328e4b6f34904c9525e4815c1a32a9e55a3ec6b0e5afa6',
'00000000000000000175b9186c4004b77ea9dc61976f4d7aed140d10919d0c05']
debug = '--debug' in sys.argv or '-d' in sys.argv
@priestc
priestc / cryptotrade.py
Last active April 22, 2022 03:01
Automatically trade cryptocurrencies
from moneywagon import get_current_price, get_address_balance
from moneywagon.tx import Transaction
from bitcoin import privkey_to_address
data = [
['btc', 'KwsccfDeJkrW6ZgMH6AJ7apNGncMVEagNWhTwq9MJnqoKp58i1MG'],
['ltc', 'T3ht4QWpi8q6sQKDpj7AKwMkDeFfZKbaBibiodmtsm1xqhcTJZT1']
]
## DETERMINE IF TRADE IS NEEDED