Skip to content

Commit

Permalink
don't use unreleased twisted.task.react
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestv committed Dec 17, 2012
1 parent e3a6c76 commit 8244c6e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions submit_badblock.py
@@ -1,16 +1,18 @@
import base64

from twisted.internet import defer, task
from twisted.internet import defer, reactor
from twisted.web import resource, server

from p2pool import networks
from p2pool.bitcoin import data, worker_interface, getwork, helper
from p2pool.util import jsonrpc, variable

@defer.inlineCallbacks
def main(reactor):
def main():
bitcoind = jsonrpc.Proxy('http://127.0.0.1:8332/', dict(Authorization='Basic ' + base64.b64encode(':password')))
block = data.block_type.unpack(open('badblock').read())
yield helper.submit_block_rpc(block, False, bitcoind, variable.Variable(dict(use_getblocktemplate=True)), networks.nets['bitcoin'])
reactor.stop()

task.react(main, [])
main()
reactor.run()

0 comments on commit 8244c6e

Please sign in to comment.