File tree Expand file tree Collapse file tree 2 files changed +7
-17
lines changed
stackslib/src/chainstate/burn/operations
testnet/stacks-node/src/burnchains Expand file tree Collapse file tree 2 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -135,33 +135,23 @@ impl LeaderKeyRegisterOp {
135
135
let num_inputs = tx. num_signers ( ) ;
136
136
let num_outputs = tx. num_recipients ( ) ;
137
137
138
- if num_inputs == 0 {
139
- test_debug ! (
138
+ if num_inputs == 0 || num_outputs < 1 {
139
+ debug ! (
140
140
"Invalid tx: inputs: {}, outputs: {}" ,
141
- num_inputs,
142
- num_outputs,
143
- ) ;
144
- return Err ( op_error:: InvalidInput ) ;
145
- }
146
-
147
- if num_outputs < 1 {
148
- test_debug ! (
149
- "Invalid tx: inputs: {}, outputs: {}" ,
150
- num_inputs,
151
- num_outputs
141
+ num_inputs, num_outputs,
152
142
) ;
153
143
return Err ( op_error:: InvalidInput ) ;
154
144
}
155
145
156
146
if tx. opcode ( ) != Opcodes :: LeaderKeyRegister as u8 {
157
- test_debug ! ( "Invalid tx: invalid opcode {}" , tx. opcode( ) ) ;
147
+ debug ! ( "Invalid tx: invalid opcode {}" , tx. opcode( ) ) ;
158
148
return Err ( op_error:: InvalidInput ) ;
159
149
}
160
150
161
151
let data = match LeaderKeyRegisterOp :: parse_data ( & tx. data ( ) ) {
162
152
Some ( data) => data,
163
153
None => {
164
- test_debug ! ( "Invalid tx data" ) ;
154
+ debug ! ( "Invalid tx data" ) ;
165
155
return Err ( op_error:: ParseError ) ;
166
156
}
167
157
} ;
Original file line number Diff line number Diff line change @@ -889,7 +889,7 @@ impl BitcoinRegtestController {
889
889
fee_rate,
890
890
& mut utxos,
891
891
signer,
892
- false ,
892
+ true , // key register op requires change output to exist
893
893
) ?;
894
894
895
895
increment_btc_ops_sent_counter ( ) ;
@@ -1466,7 +1466,7 @@ impl BitcoinRegtestController {
1466
1466
fee_rate,
1467
1467
& mut utxos,
1468
1468
signer,
1469
- true , // only block commit op requires change output to exist
1469
+ true , // block commit op requires change output to exist
1470
1470
) ?;
1471
1471
1472
1472
let serialized_tx = SerializedTx :: new ( tx. clone ( ) ) ;
You can’t perform that action at this time.
0 commit comments