File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
programs/drift/src/instructions Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -239,8 +239,9 @@ pub fn handle_initialize_user<'c: 'info, 'info>(
239239 ) ?;
240240 }
241241
242+ let authority_is_signer = ctx. accounts . authority . is_signer ;
242243 #[ cfg( feature = "mainnet-beta" ) ]
243- if ctx. accounts . authority . key ( ) != ctx. accounts . payer . key ( ) {
244+ if !authority_is_signer && ctx. accounts . authority . key ( ) != ctx. accounts . payer . key ( ) {
244245 validate ! (
245246 WHITELISTED_EXTERNAL_DEPOSITORS . contains( & ctx. accounts. payer. key( ) ) ,
246247 ErrorCode :: DefaultError ,
@@ -283,8 +284,9 @@ pub fn handle_initialize_user_stats<'c: 'info, 'info>(
283284 ErrorCode :: MaxNumberOfUsers
284285 ) ?;
285286
287+ let authority_is_signer = ctx. accounts . authority . is_signer ;
286288 #[ cfg( feature = "mainnet-beta" ) ]
287- if ctx. accounts . authority . key ( ) != ctx. accounts . payer . key ( ) {
289+ if !authority_is_signer && ctx. accounts . authority . key ( ) != ctx. accounts . payer . key ( ) {
288290 validate ! (
289291 WHITELISTED_EXTERNAL_DEPOSITORS . contains( & ctx. accounts. payer. key( ) ) ,
290292 ErrorCode :: DefaultError ,
You can’t perform that action at this time.
0 commit comments