Merge "Only apply pendingTransaction if hasPendingTransaction is true" into main