Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

segwit support #16

Merged
merged 3 commits into from
Dec 13, 2016
Merged

segwit support #16

merged 3 commits into from
Dec 13, 2016

Conversation

theuni
Copy link
Contributor

@theuni theuni commented Nov 29, 2016

Adds support for requesting segwit support in gbt calls, as well as the necessary commitment insertion.

Commitments will be inserted even before segwit activation, so it's possible to verify that the insertion works far in advance.

Compares the calculated commitment to the one provided by bitcoind, if present, as an extra sanity check.

This has been removed for a while.
Rather than trying to de-serialize and re-serialize the transactions coming
from GBT, simply store them as binary and use them directly to form the block.

Also, override CBlock's checks that assume the merkle root represents the full
transaction hashes.
@zsulocal
Copy link

zsulocal commented Dec 1, 2016

BTCC Pool has already tested this PR and submit valid blocks on testnet. Block #1035755 only contains coinbase transaction and #1035760 contains segwit transactions. Apart from these two blocks, all coinbase transaction contain the tag '/BTCC/' , meaning mined by BTCC Pool.

@slush0
Copy link
Owner

slush0 commented Dec 8, 2016

Thank you for this PR! I'm watching segwit.co closely and if adoption rise near 50% (I hope so), I'll merge this.

@wuhuaping
Copy link

wuhuaping commented Dec 9, 2016 via email

@jameshilliard
Copy link

@slush0 FYI bitcoin 0.13.1 won't actually signal for SegWit activation without this patch so it would probably be a good idea to merge before hand.

@theuni
Copy link
Contributor Author

theuni commented Dec 12, 2016

What @jameshilliard said. Pools can't (or shouldn't be) signaling for segwit until they advertise that they can actually produce valid blocks with witnesses.

To be clear, this should have no negative effects on current mainnet mining, even before segwit activates. The commitment insertion is not harmful in either case.

In fact, this PR currently required for using this software on testnet, where segwit is already active. Otherwise, gbt simply refuses to give it a template.

@slush0 slush0 merged commit b2a24d7 into slush0:master Dec 13, 2016
@slush0
Copy link
Owner

slush0 commented Dec 13, 2016

Okay, done. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants