File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -138,17 +138,15 @@ impl NegotiationContext {
138
138
}
139
139
140
140
let transaction = msg. prevtx . as_transaction ( ) ;
141
+ let txid = transaction. txid ( ) ;
141
142
142
143
if let Some ( tx_out) = transaction. output . get ( msg. prevtx_out as usize ) {
143
144
if !tx_out. script_pubkey . is_witness_program ( ) {
144
145
// The receiving node:
145
146
// - MUST fail the negotiation if:
146
147
// - the `scriptPubKey` is not a witness program
147
148
return Err ( AbortReason :: PrevTxOutInvalid ) ;
148
- } else if !self
149
- . prevtx_outpoints
150
- . insert ( OutPoint { txid : transaction. txid ( ) , vout : msg. prevtx_out } )
151
- {
149
+ } else if !self . prevtx_outpoints . insert ( OutPoint { txid, vout : msg. prevtx_out } ) {
152
150
// The receiving node:
153
151
// - MUST fail the negotiation if:
154
152
// - the `prevtx` and `prevtx_vout` are identical to a previously added
@@ -173,7 +171,7 @@ impl NegotiationContext {
173
171
// - the `serial_id` is already included in the transaction
174
172
return Err ( AbortReason :: DuplicateSerialId ) ;
175
173
}
176
- let prev_outpoint = OutPoint { txid : transaction . txid ( ) , vout : msg. prevtx_out } ;
174
+ let prev_outpoint = OutPoint { txid, vout : msg. prevtx_out } ;
177
175
self . inputs . insert (
178
176
msg. serial_id ,
179
177
TxInputWithPrevOutput {
You can’t perform that action at this time.
0 commit comments