Skip to content

Commit a1ebc8b

Browse files
committed
solana: Block redeem when there are no transceivers
1 parent 8a5b68d commit a1ebc8b

File tree

1 file changed

+4
-0
lines changed
  • solana/programs/example-native-token-transfers/src/instructions

1 file changed

+4
-0
lines changed

solana/programs/example-native-token-transfers/src/instructions/redeem.rs

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ pub struct Redeem<'info> {
2222
pub payer: Signer<'info>,
2323

2424
// NOTE: this works when the contract is paused
25+
#[account(
26+
constraint = config.next_transceiver_id != 0 @ NTTError::NoRegisteredTransceivers,
27+
constraint = config.enabled_transceivers.is_empty() @ NTTError::NoRegisteredTransceivers,
28+
)]
2529
pub config: Account<'info, Config>,
2630

2731
#[account(

0 commit comments

Comments
 (0)