File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,8 @@ static CScript PushAll(const std::vector<valtype>& values)
177177 result << OP_0;
178178 } else if (v.size () == 1 && v[0 ] >= 1 && v[0 ] <= 16 ) {
179179 result << CScript::EncodeOP_N (v[0 ]);
180+ } else if (v.size () == 1 && v[0 ] == 0x81 ) {
181+ result << OP_1NEGATE;
180182 } else {
181183 result << v;
182184 }
Original file line number Diff line number Diff line change @@ -121,9 +121,29 @@ def script_verification_error_test(self):
121121 assert_equal (rawTxSigned ['errors' ][1 ]['txid' ], inputs [2 ]['txid' ])
122122 assert_equal (rawTxSigned ['errors' ][1 ]['vout' ], inputs [2 ]['vout' ])
123123
124+ def OP_1NEGATE_test (self ):
125+ self .log .info ("Test OP_1NEGATE (0x4f) satisfies BIP62 minimal push standardness rule" )
126+ hex_str = (
127+ "0200000001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
128+ "FFFFFFFF00000000044F024F9CFDFFFFFF01F0B9F5050000000023210277777777"
129+ "77777777777777777777777777777777777777777777777777777777AC66030000"
130+ )
131+ prev_txs = [
132+ {
133+ "txid" : "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" ,
134+ "vout" : 0 ,
135+ "scriptPubKey" : "A914AE44AB6E9AA0B71F1CD2B453B69340E9BFBAEF6087" ,
136+ "redeemScript" : "4F9C" ,
137+ "amount" : 1 ,
138+ }
139+ ]
140+ txn = self .nodes [0 ].signrawtransactionwithwallet (hex_str , prev_txs )
141+ assert txn ["complete" ]
142+
124143 def run_test (self ):
125144 self .successful_signing_test ()
126145 self .script_verification_error_test ()
146+ self .OP_1NEGATE_test ()
127147 self .test_with_lock_outputs ()
128148
129149
You can’t perform that action at this time.
0 commit comments