Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Python3 #25

Open
wants to merge 34 commits into
base: 1mb_segwit
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e8bb4fb
Update the seed nodes.
Sep 14, 2018
84d704e
Bech32 + P2SH Mining Address support
spencerr Jun 9, 2018
cefeabd
Update litecoin_testnet for v0.16.
Sep 20, 2018
476dc51
Update the Share upgrade warning message and README for mining to P2SH
Sep 20, 2018
d2060c7
Added cashaddr support.
Oct 3, 2018
b3dced4
Changed the shares to use the address instead of the pubkey hash since
Oct 4, 2018
176161d
Fix P2SH segwit addresses.
Oct 9, 2018
247bff3
Update unittest for fixed segwit script2.
Oct 9, 2018
c85d0cf
Fix the dest calculation.
Oct 10, 2018
875ea66
Update block explorer for bitcoincash testnet.
Oct 10, 2018
27f4727
Fixed bugs in the cashaddress code. All cashaddress types are now
Oct 13, 2018
a3ecde9
Enable the DONATION_SCRIPT to be a multisig script.
Nov 17, 2018
8665276
Update the seed nodes.
Sep 14, 2018
38f4224
Bech32 + P2SH Mining Address support
spencerr Jun 9, 2018
b98fa34
Update litecoin_testnet for v0.16.
Sep 20, 2018
e2e5d69
Update the Share upgrade warning message and README for mining to P2SH
Sep 20, 2018
b00b07c
Added cashaddr support.
Oct 3, 2018
ae2a2f6
Changed the shares to use the address instead of the pubkey hash since
Oct 4, 2018
5a51aa6
Fix P2SH segwit addresses.
Oct 9, 2018
8212ef8
Update unittest for fixed segwit script2.
Oct 9, 2018
2bc60ef
Fix the dest calculation.
Oct 10, 2018
331df87
Update block explorer for bitcoincash testnet.
Oct 10, 2018
1c48060
Fixed bugs in the cashaddress code. All cashaddress types are now
Oct 13, 2018
f2905d9
Enable the DONATION_SCRIPT to be a multisig script.
Nov 17, 2018
d484515
Merge branch 'p2pool-fixes' of github.com:rldleblanc/p2pool into p2po…
Dec 28, 2018
ca654dc
More address fixes around the web interface.
Dec 28, 2018
1bcbc44
Prelimary changes to remove TXs from the share chain.
Dec 28, 2018
d9a32fd
Fix share version check in block submission.
Dec 28, 2018
e8ec9b0
A few transaction fixes.
Dec 29, 2018
fdf5852
Clear out the TX cache when a new block has been found.
Jan 5, 2019
878b2f1
Optimized calculate_merkle_link and achived an ~90% reduction in
Jan 11, 2019
82e02f5
Migrated to Python3. Works with pypy3.
Jan 16, 2019
94e6457
Cleaned up the build process. Removed the old stuff that wasn't working
Feb 20, 2019
e6dd0da
Fixed bug where installing systemwide and run as a regular user could
Apr 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Enable the DONATION_SCRIPT to be a multisig script.
  • Loading branch information
Robert LeBlanc committed Nov 17, 2018
commit a3ecde9f898d660b2900f4ea12f096e8c848bbbf
13 changes: 9 additions & 4 deletions p2pool/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ def is_segwit_activated(version, net):
return version >= segwit_activation_version and segwit_activation_version > 0

DONATION_SCRIPT = '4104ffd03de44a6e11b9917f3a29f9443283d9871c9d743ef30d5eddcd37094b64d1b3d8090496b53256786bf5c82932ec23c3b74d9f05a6f95a8b5529352656664bac'.decode('hex')
def donation_script_to_address(net):
try:
return bitcoin_data.script2_to_address(
DONATION_SCRIPT, net.PARENT.ADDRESS_VERSION, -1, net.PARENT)
except ValueError:
return bitcoin_data.script2_to_address(
DONATION_SCRIPT, net.PARENT.ADDRESS_P2SH_VERSION, -1, net.PARENT)

class BaseShare(object):
VERSION = 0
Expand Down Expand Up @@ -252,8 +259,7 @@ def generate_transaction(cls, tracker, share_data, block_target, desired_timesta
-1, net.PARENT)
else:
this_address = share_data['address']
donation_address = bitcoin_data.script2_to_address(
DONATION_SCRIPT, net.PARENT.ADDRESS_VERSION, -1, net.PARENT)
donation_address = donation_script_to_address(net)
# 0.5% goes to block finder
amounts[this_address] = amounts.get(this_address, 0) \
+ share_data['subsidy']//200
Expand Down Expand Up @@ -887,8 +893,7 @@ def get_user_stale_props(tracker, share_hash, lookbehind):
def get_expected_payouts(tracker, best_share_hash, block_target, subsidy, net):
weights, total_weight, donation_weight = tracker.get_cumulative_weights(best_share_hash, min(tracker.get_height(best_share_hash), net.REAL_CHAIN_LENGTH), 65535*net.SPREAD*bitcoin_data.target_to_average_attempts(block_target))
res = dict((script, subsidy*weight//total_weight) for script, weight in weights.iteritems())
donation_addr = bitcoin_data.script2_to_address(
DONATION_SCRIPT, net.PARENT.ADDRESS_VERSION, -1, net.PARENT)
donation_addr = donation_script_to_address(net)
res[donation_addr] = res.get(donation_addr, 0) + subsidy - sum(res.itervalues())
return res

Expand Down