diff options
| author | Suhas Daftuar <[email protected]> | 2017-03-08 15:56:59 -0500 |
|---|---|---|
| committer | Suhas Daftuar <[email protected]> | 2017-03-14 06:43:37 -0400 |
| commit | abe7b3d3abe10e3554b770f40824174b3b217490 (patch) | |
| tree | 45054c26ef435b80eebdf9c5965023592b749e63 /qa | |
| parent | Merge #9970: Improve readability of segwit.py, smartfees.py (diff) | |
| download | discoin-abe7b3d3abe10e3554b770f40824174b3b217490.tar.xz discoin-abe7b3d3abe10e3554b770f40824174b3b217490.zip | |
Don't require segwit in getblocktemplate for segwit signalling or mining
Segwit's version bit will be signalled for all invocations of CreateNewBlock,
and not specifying segwit only will cause CreateNewBlock to skip transactions
with witness from being selected.
Diffstat (limited to 'qa')
| -rwxr-xr-x | qa/rpc-tests/p2p-segwit.py | 8 | ||||
| -rwxr-xr-x | qa/rpc-tests/segwit.py | 9 |
2 files changed, 11 insertions, 6 deletions
diff --git a/qa/rpc-tests/p2p-segwit.py b/qa/rpc-tests/p2p-segwit.py index 0f844883b..dcf2b9a7d 100755 --- a/qa/rpc-tests/p2p-segwit.py +++ b/qa/rpc-tests/p2p-segwit.py @@ -1698,9 +1698,11 @@ class SegWitTest(BitcoinTestFramework): for node in [self.nodes[0], self.nodes[2]]: gbt_results = node.getblocktemplate() block_version = gbt_results['version'] - # If we're not indicating segwit support, we should not be signalling - # for segwit activation, nor should we get a witness commitment. - assert_equal(block_version & (1 << VB_WITNESS_BIT), 0) + # If we're not indicating segwit support, we will still be + # signalling for segwit activation. + assert_equal((block_version & (1 << VB_WITNESS_BIT) != 0), node == self.nodes[0]) + # If we don't specify the segwit rule, then we won't get a default + # commitment. assert('default_witness_commitment' not in gbt_results) # Workaround: diff --git a/qa/rpc-tests/segwit.py b/qa/rpc-tests/segwit.py index 36eb0dbdc..50ace12aa 100755 --- a/qa/rpc-tests/segwit.py +++ b/qa/rpc-tests/segwit.py @@ -250,9 +250,12 @@ class SegWitTest(BitcoinTestFramework): assert(tmpl['transactions'][0]['txid'] == txid) assert(tmpl['transactions'][0]['sigops'] == 8) - self.log.info("Non-segwit miners are not able to use GBT response after activation.") - send_to_witness(1, self.nodes[0], find_unspent(self.nodes[0], 50), self.pubkey[0], False, Decimal("49.998")) - assert_raises_jsonrpc(-8, "Support for 'segwit' rule requires explicit client support", self.nodes[0].getblocktemplate, {}) + self.log.info("Non-segwit miners are able to use GBT response after activation.") + txid = send_to_witness(1, self.nodes[0], find_unspent(self.nodes[0], 50), self.pubkey[0], False, Decimal("49.998")) + #assert_raises_jsonrpc(-8, "Support for 'segwit' rule requires explicit client support", self.nodes[0].getblocktemplate, {}) + tmpl = self.nodes[0].getblocktemplate() + # TODO: add a transaction with witness to mempool, and verify it's not + # selected for mining. self.log.info("Verify behaviour of importaddress, addwitnessaddress and listunspent") |