File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -626,11 +626,21 @@ impl<FG: ForkGraph> TransactionBatchProcessor<FG> {
626626
627627 let mut loaded_fee_payer = if fee_lamports_per_signature == 0 {
628628 // zero-fee: use provided account if any, otherwise an empty default
629- initial_loaded. unwrap_or_else ( || LoadedTransactionAccount {
630- account : AccountSharedData :: default ( ) ,
631- loaded_size : 0 ,
632- rent_collected : 0 ,
633- } )
629+ if let Some ( feepayer) = initial_loaded {
630+ // we check that if the fee payer is used as writeable, then it must be
631+ // subject to the same if writeable then must be delegated rule.
632+ if message. is_writable ( 0 ) && !is_delegated_or_privileged ( & feepayer) {
633+ error_counters. invalid_account_for_fee += 1 ;
634+ return Err ( TransactionError :: InvalidAccountForFee ) ;
635+ }
636+ feepayer
637+ } else {
638+ LoadedTransactionAccount {
639+ account : Default :: default ( ) ,
640+ loaded_size : 0 ,
641+ rent_collected : 0 ,
642+ }
643+ }
634644 } else {
635645 initial_loaded
636646 . filter ( is_delegated_or_privileged)
You can’t perform that action at this time.
0 commit comments