@@ -46,7 +46,7 @@ use io;
4646use prelude:: * ;
4747use core:: { cmp, mem, fmt} ;
4848use core:: ops:: Deref ;
49- #[ cfg( any( test, feature = "fuzztarget" , debug_assertions) ) ]
49+ #[ cfg( any( test, fuzzing , debug_assertions) ) ]
5050use sync:: Mutex ;
5151use bitcoin:: hashes:: hex:: ToHex ;
5252
@@ -670,9 +670,9 @@ pub(super) struct Channel<Signer: Sign> {
670670 // `next_remote_commit_tx_fee_msat` properly predict what the next commitment transaction fee will
671671 // be, by comparing the cached values to the fee of the tranaction generated by
672672 // `build_commitment_transaction`.
673- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
673+ #[ cfg( any( test, fuzzing ) ) ]
674674 next_local_commitment_tx_fee_info_cached : Mutex < Option < CommitmentTxInfoCached > > ,
675- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
675+ #[ cfg( any( test, fuzzing ) ) ]
676676 next_remote_commitment_tx_fee_info_cached : Mutex < Option < CommitmentTxInfoCached > > ,
677677
678678 /// lnd has a long-standing bug where, upon reconnection, if the channel is not yet confirmed
@@ -684,7 +684,7 @@ pub(super) struct Channel<Signer: Sign> {
684684 /// See-also <https://github.com/lightningnetwork/lnd/issues/4006>
685685 pub workaround_lnd_bug_4006 : Option < msgs:: FundingLocked > ,
686686
687- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
687+ #[ cfg( any( test, fuzzing ) ) ]
688688 // When we receive an HTLC fulfill on an outbound path, we may immediately fulfill the
689689 // corresponding HTLC on the inbound path. If, then, the outbound path channel is
690690 // disconnected and reconnected (before we've exchange commitment_signed and revoke_and_ack
@@ -697,7 +697,7 @@ pub(super) struct Channel<Signer: Sign> {
697697 channel_type : ChannelTypeFeatures ,
698698}
699699
700- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
700+ #[ cfg( any( test, fuzzing ) ) ]
701701struct CommitmentTxInfoCached {
702702 fee : u64 ,
703703 total_pending_htlcs : usize ,
@@ -940,14 +940,14 @@ impl<Signer: Sign> Channel<Signer> {
940940
941941 announcement_sigs : None ,
942942
943- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
943+ #[ cfg( any( test, fuzzing ) ) ]
944944 next_local_commitment_tx_fee_info_cached : Mutex :: new ( None ) ,
945- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
945+ #[ cfg( any( test, fuzzing ) ) ]
946946 next_remote_commitment_tx_fee_info_cached : Mutex :: new ( None ) ,
947947
948948 workaround_lnd_bug_4006 : None ,
949949
950- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
950+ #[ cfg( any( test, fuzzing ) ) ]
951951 historical_inbound_htlc_fulfills : HashSet :: new ( ) ,
952952
953953 // We currently only actually support one channel type, so don't retry with new types
@@ -1245,14 +1245,14 @@ impl<Signer: Sign> Channel<Signer> {
12451245
12461246 announcement_sigs : None ,
12471247
1248- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
1248+ #[ cfg( any( test, fuzzing ) ) ]
12491249 next_local_commitment_tx_fee_info_cached : Mutex :: new ( None ) ,
1250- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
1250+ #[ cfg( any( test, fuzzing ) ) ]
12511251 next_remote_commitment_tx_fee_info_cached : Mutex :: new ( None ) ,
12521252
12531253 workaround_lnd_bug_4006 : None ,
12541254
1255- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
1255+ #[ cfg( any( test, fuzzing ) ) ]
12561256 historical_inbound_htlc_fulfills : HashSet :: new ( ) ,
12571257
12581258 channel_type,
@@ -1650,7 +1650,7 @@ impl<Signer: Sign> Channel<Signer> {
16501650 }
16511651 }
16521652 if pending_idx == core:: usize:: MAX {
1653- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
1653+ #[ cfg( any( test, fuzzing ) ) ]
16541654 // If we failed to find an HTLC to fulfill, make sure it was previously fulfilled and
16551655 // this is simply a duplicate claim, not previously failed and we lost funds.
16561656 debug_assert ! ( self . historical_inbound_htlc_fulfills. contains( & htlc_id_arg) ) ;
@@ -1676,7 +1676,7 @@ impl<Signer: Sign> Channel<Signer> {
16761676 if htlc_id_arg == htlc_id {
16771677 // Make sure we don't leave latest_monitor_update_id incremented here:
16781678 self . latest_monitor_update_id -= 1 ;
1679- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
1679+ #[ cfg( any( test, fuzzing ) ) ]
16801680 debug_assert ! ( self . historical_inbound_htlc_fulfills. contains( & htlc_id_arg) ) ;
16811681 return UpdateFulfillFetch :: DuplicateClaim { } ;
16821682 }
@@ -1697,11 +1697,11 @@ impl<Signer: Sign> Channel<Signer> {
16971697 self . holding_cell_htlc_updates . push ( HTLCUpdateAwaitingACK :: ClaimHTLC {
16981698 payment_preimage : payment_preimage_arg, htlc_id : htlc_id_arg,
16991699 } ) ;
1700- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
1700+ #[ cfg( any( test, fuzzing ) ) ]
17011701 self . historical_inbound_htlc_fulfills . insert ( htlc_id_arg) ;
17021702 return UpdateFulfillFetch :: NewClaim { monitor_update, htlc_value_msat, msg : None } ;
17031703 }
1704- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
1704+ #[ cfg( any( test, fuzzing ) ) ]
17051705 self . historical_inbound_htlc_fulfills . insert ( htlc_id_arg) ;
17061706
17071707 {
@@ -1782,7 +1782,7 @@ impl<Signer: Sign> Channel<Signer> {
17821782 }
17831783 }
17841784 if pending_idx == core:: usize:: MAX {
1785- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
1785+ #[ cfg( any( test, fuzzing ) ) ]
17861786 // If we failed to find an HTLC to fail, make sure it was previously fulfilled and this
17871787 // is simply a duplicate fail, not previously failed and we failed-back too early.
17881788 debug_assert ! ( self . historical_inbound_htlc_fulfills. contains( & htlc_id_arg) ) ;
@@ -1795,7 +1795,7 @@ impl<Signer: Sign> Channel<Signer> {
17951795 match pending_update {
17961796 & HTLCUpdateAwaitingACK :: ClaimHTLC { htlc_id, .. } => {
17971797 if htlc_id_arg == htlc_id {
1798- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
1798+ #[ cfg( any( test, fuzzing ) ) ]
17991799 debug_assert ! ( self . historical_inbound_htlc_fulfills. contains( & htlc_id_arg) ) ;
18001800 return Ok ( None ) ;
18011801 }
@@ -2367,7 +2367,7 @@ impl<Signer: Sign> Channel<Signer> {
23672367
23682368 let num_htlcs = included_htlcs + addl_htlcs;
23692369 let res = Self :: commit_tx_fee_msat ( self . feerate_per_kw , num_htlcs, self . opt_anchors ( ) ) ;
2370- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
2370+ #[ cfg( any( test, fuzzing ) ) ]
23712371 {
23722372 let mut fee = res;
23732373 if fee_spike_buffer_htlc. is_some ( ) {
@@ -2445,7 +2445,7 @@ impl<Signer: Sign> Channel<Signer> {
24452445
24462446 let num_htlcs = included_htlcs + addl_htlcs;
24472447 let res = Self :: commit_tx_fee_msat ( self . feerate_per_kw , num_htlcs, self . opt_anchors ( ) ) ;
2448- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
2448+ #[ cfg( any( test, fuzzing ) ) ]
24492449 {
24502450 let mut fee = res;
24512451 if fee_spike_buffer_htlc. is_some ( ) {
@@ -2728,7 +2728,7 @@ impl<Signer: Sign> Channel<Signer> {
27282728 return Err ( ( None , ChannelError :: Close ( "Funding remote cannot afford proposed new fee" . to_owned ( ) ) ) ) ;
27292729 }
27302730 }
2731- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
2731+ #[ cfg( any( test, fuzzing ) ) ]
27322732 {
27332733 if self . is_outbound ( ) {
27342734 let projected_commit_tx_info = self . next_local_commitment_tx_fee_info_cached . lock ( ) . unwrap ( ) . take ( ) ;
@@ -3035,7 +3035,7 @@ impl<Signer: Sign> Channel<Signer> {
30353035 return Err ( ChannelError :: Close ( "Received an unexpected revoke_and_ack" . to_owned ( ) ) ) ;
30363036 }
30373037
3038- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
3038+ #[ cfg( any( test, fuzzing ) ) ]
30393039 {
30403040 * self . next_local_commitment_tx_fee_info_cached . lock ( ) . unwrap ( ) = None ;
30413041 * self . next_remote_commitment_tx_fee_info_cached . lock ( ) . unwrap ( ) = None ;
@@ -4466,9 +4466,9 @@ impl<Signer: Sign> Channel<Signer> {
44664466 // If we generated the funding transaction and it doesn't match what it
44674467 // should, the client is really broken and we should just panic and
44684468 // tell them off. That said, because hash collisions happen with high
4469- // probability in fuzztarget mode, if we're fuzzing we just close the
4469+ // probability in fuzzing mode, if we're fuzzing we just close the
44704470 // channel and move on.
4471- #[ cfg( not( feature = "fuzztarget" ) ) ]
4471+ #[ cfg( not( fuzzing ) ) ]
44724472 panic ! ( "Client called ChannelManager::funding_transaction_generated with bogus transaction!" ) ;
44734473 }
44744474 self . update_time_counter += 1 ;
@@ -4480,7 +4480,7 @@ impl<Signer: Sign> Channel<Signer> {
44804480 if input. witness . is_empty ( ) {
44814481 // We generated a malleable funding transaction, implying we've
44824482 // just exposed ourselves to funds loss to our counterparty.
4483- #[ cfg( not( feature = "fuzztarget" ) ) ]
4483+ #[ cfg( not( fuzzing ) ) ]
44844484 panic ! ( "Client called ChannelManager::funding_transaction_generated with bogus transaction!" ) ;
44854485 }
44864486 }
@@ -4937,9 +4937,9 @@ impl<Signer: Sign> Channel<Signer> {
49374937 // Prior to static_remotekey, my_current_per_commitment_point was critical to claiming
49384938 // current to_remote balances. However, it no longer has any use, and thus is now simply
49394939 // set to a dummy (but valid, as required by the spec) public key.
4940- // fuzztarget mode marks a subset of pubkeys as invalid so that we can hit "invalid pubkey"
4940+ // fuzzing mode marks a subset of pubkeys as invalid so that we can hit "invalid pubkey"
49414941 // branches, but we unwrap it below, so we arbitrarily select a dummy pubkey which is both
4942- // valid, and valid in fuzztarget mode's arbitrary validity criteria:
4942+ // valid, and valid in fuzzing mode's arbitrary validity criteria:
49434943 let mut pk = [ 2 ; 33 ] ; pk[ 1 ] = 0xff ;
49444944 let dummy_pubkey = PublicKey :: from_slice ( & pk) . unwrap ( ) ;
49454945 let data_loss_protect = if self . cur_counterparty_commitment_transaction_number + 1 < INITIAL_COMMITMENT_NUMBER {
@@ -5225,7 +5225,7 @@ impl<Signer: Sign> Channel<Signer> {
52255225 let counterparty_commitment_txid = commitment_stats. tx . trust ( ) . txid ( ) ;
52265226 let ( signature, htlc_signatures) ;
52275227
5228- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
5228+ #[ cfg( any( test, fuzzing ) ) ]
52295229 {
52305230 if !self . is_outbound ( ) {
52315231 let projected_commit_tx_info = self . next_remote_commitment_tx_fee_info_cached . lock ( ) . unwrap ( ) . take ( ) ;
@@ -5711,9 +5711,9 @@ impl<Signer: Sign> Writeable for Channel<Signer> {
57115711
57125712 self . channel_update_status . write ( writer) ?;
57135713
5714- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
5714+ #[ cfg( any( test, fuzzing ) ) ]
57155715 ( self . historical_inbound_htlc_fulfills . len ( ) as u64 ) . write ( writer) ?;
5716- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
5716+ #[ cfg( any( test, fuzzing ) ) ]
57175717 for htlc in self . historical_inbound_htlc_fulfills . iter ( ) {
57185718 htlc. write ( writer) ?;
57195719 }
@@ -5975,9 +5975,9 @@ impl<'a, Signer: Sign, K: Deref> ReadableArgs<(&'a K, u32)> for Channel<Signer>
59755975
59765976 let channel_update_status = Readable :: read ( reader) ?;
59775977
5978- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
5978+ #[ cfg( any( test, fuzzing ) ) ]
59795979 let mut historical_inbound_htlc_fulfills = HashSet :: new ( ) ;
5980- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
5980+ #[ cfg( any( test, fuzzing ) ) ]
59815981 {
59825982 let htlc_fulfills_len: u64 = Readable :: read ( reader) ?;
59835983 for _ in 0 ..htlc_fulfills_len {
@@ -6151,14 +6151,14 @@ impl<'a, Signer: Sign, K: Deref> ReadableArgs<(&'a K, u32)> for Channel<Signer>
61516151
61526152 announcement_sigs,
61536153
6154- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
6154+ #[ cfg( any( test, fuzzing ) ) ]
61556155 next_local_commitment_tx_fee_info_cached : Mutex :: new ( None ) ,
6156- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
6156+ #[ cfg( any( test, fuzzing ) ) ]
61576157 next_remote_commitment_tx_fee_info_cached : Mutex :: new ( None ) ,
61586158
61596159 workaround_lnd_bug_4006 : None ,
61606160
6161- #[ cfg( any( test, feature = "fuzztarget" ) ) ]
6161+ #[ cfg( any( test, fuzzing ) ) ]
61626162 historical_inbound_htlc_fulfills,
61636163
61646164 channel_type : channel_type. unwrap ( ) ,
0 commit comments