Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't use unreleased twisted.task.react
- Loading branch information
Showing
1 changed file
with
5 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |