Skip to content

Commit c634b1e

Browse files
committed
[POLICY] Make sending to future native witness outputs standard
1 parent 2d4f70c commit c634b1e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/policy/policy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType)
5959
std::vector<std::vector<unsigned char> > vSolutions;
6060
whichType = Solver(scriptPubKey, vSolutions);
6161

62-
if (whichType == TX_NONSTANDARD || whichType == TX_WITNESS_UNKNOWN) {
62+
if (whichType == TX_NONSTANDARD) {
6363
return false;
6464
} else if (whichType == TX_MULTISIG) {
6565
unsigned char m = vSolutions.front()[0];

test/functional/p2p_segwit.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,8 @@ def test_tx_relay_after_segwit_activation(self):
13571357
def test_segwit_versions(self):
13581358
"""Test validity of future segwit version transactions.
13591359
1360-
Future segwit version transactions are non-standard, but valid in blocks.
1360+
Future segwit versions are non-standard to spend, but valid in blocks.
1361+
Sending to future segwit versions is always allowed.
13611362
Can run this before and after segwit activation."""
13621363

13631364
NUM_SEGWIT_VERSIONS = 17 # will test OP_0, OP1, ..., OP_16
@@ -1397,18 +1398,17 @@ def test_segwit_versions(self):
13971398
assert len(self.nodes[0].getrawmempool()) == 0
13981399

13991400
# Finally, verify that version 0 -> version 1 transactions
1400-
# are non-standard
1401+
# are standard
14011402
script_pubkey = CScript([CScriptOp(OP_1), witness_hash])
14021403
tx2 = CTransaction()
14031404
tx2.vin = [CTxIn(COutPoint(tx.sha256, 0), b"")]
14041405
tx2.vout = [CTxOut(tx.vout[0].nValue - 1000, script_pubkey)]
14051406
tx2.wit.vtxinwit.append(CTxInWitness())
14061407
tx2.wit.vtxinwit[0].scriptWitness.stack = [witness_program]
14071408
tx2.rehash()
1408-
# Gets accepted to test_node, because standardness of outputs isn't
1409-
# checked with fRequireStandard
1409+
# Gets accepted to both policy-enforcing nodes and others.
14101410
test_transaction_acceptance(self.nodes[0], self.test_node, tx2, with_witness=True, accepted=True)
1411-
test_transaction_acceptance(self.nodes[1], self.std_node, tx2, with_witness=True, accepted=False)
1411+
test_transaction_acceptance(self.nodes[1], self.std_node, tx2, with_witness=True, accepted=True)
14121412
temp_utxo.pop() # last entry in temp_utxo was the output we just spent
14131413
temp_utxo.append(UTXO(tx2.sha256, 0, tx2.vout[0].nValue))
14141414

0 commit comments

Comments
 (0)